hi?
how can i achieve that?
world angle of bone?
Moderators: Víctor Paredes, Belgarath, slowtiger
- davoodice2
- Posts: 381
- Joined: Tue Jun 15, 2021 1:14 pm
world angle of bone?
خیام اگر ز باده مستی خوش باش
با ماهرخی اگر نشستی خوش باش
چون عاقبت کار جهان نیستی است
انگار که نیستی چو هستی خوش باش
با ماهرخی اگر نشستی خوش باش
چون عاقبت کار جهان نیستی است
انگار که نیستی چو هستی خوش باش
- hayasidist
- Posts: 3557
- Joined: Wed Feb 16, 2011 8:12 pm
- Location: Kent, England
Re: world angle of bone?
2d case : i.e. no rotation about x/y
for a root bone (i.e. one without a parent) bone.fAngle is absolute; for a child bone bone.fAngle is relative to its parent so (e.g.) two bones - one root, one child - pointing down will have angles 270 and 0 respectively.
those are relative to the layer; so if (e.g.) the layer is rotated in z by (say) 90 then bone.fAngle is unchanged, but the bone will be pointing to the right - i.e. world 90+270 (or that mod 360 = 0)
for a root bone (i.e. one without a parent) bone.fAngle is absolute; for a child bone bone.fAngle is relative to its parent so (e.g.) two bones - one root, one child - pointing down will have angles 270 and 0 respectively.
those are relative to the layer; so if (e.g.) the layer is rotated in z by (say) 90 then bone.fAngle is unchanged, but the bone will be pointing to the right - i.e. world 90+270 (or that mod 360 = 0)
- davoodice2
- Posts: 381
- Joined: Tue Jun 15, 2021 1:14 pm
Re: world angle of bone?
that means I must calculate sum of all rotations ?hayasidist wrote: ↑Mon Nov 15, 2021 11:45 am 2d case : i.e. no rotation about x/y
for a root bone (i.e. one without a parent) bone.fAngle is absolute; for a child bone bone.fAngle is relative to its parent so (e.g.) two bones - one root, one child - pointing down will have angles 270 and 0 respectively.
those are relative to the layer; so if (e.g.) the layer is rotated in z by (say) 90 then bone.fAngle is unchanged, but the bone will be pointing to the right - i.e. world 90+270 (or that mod 360 = 0)
is there shortway? or function?
and how to define a vector that doesn't start from 0,0
خیام اگر ز باده مستی خوش باش
با ماهرخی اگر نشستی خوش باش
چون عاقبت کار جهان نیستی است
انگار که نیستی چو هستی خوش باش
با ماهرخی اگر نشستی خوش باش
چون عاقبت کار جهان نیستی است
انگار که نیستی چو هستی خوش باش
- hayasidist
- Posts: 3557
- Joined: Wed Feb 16, 2011 8:12 pm
- Location: Kent, England
Re: world angle of bone?
depends what you're trying to do ... you might find that a bone transform matrix (fRest or fMoved) will do what you want -- or you might find it makes sense to use a Matrix to accumulate the rotations and translations.
as for vectors that don't start from {0,0} ... well at the risk of totally misunderstanding what you're thinking here ... an LM_Vector2 has an x value and y value, so if you want your vector to start at {X0, Y0} and go to {X1, Y1} you can store those two vectors exactly like that - or if you have a vector that is {dX, dY} wrt {0,0} then X1=X0+dX, Y1=Y0+dY - either store dX,dY and remember to add - or add and store the result
as for vectors that don't start from {0,0} ... well at the risk of totally misunderstanding what you're thinking here ... an LM_Vector2 has an x value and y value, so if you want your vector to start at {X0, Y0} and go to {X1, Y1} you can store those two vectors exactly like that - or if you have a vector that is {dX, dY} wrt {0,0} then X1=X0+dX, Y1=Y0+dY - either store dX,dY and remember to add - or add and store the result
- davoodice2
- Posts: 381
- Joined: Tue Jun 15, 2021 1:14 pm
Re: world angle of bone?
thanks. i will some test . i'll come back with more questionshayasidist wrote: ↑Mon Nov 15, 2021 3:30 pm depends what you're trying to do ... you might find that a bone transform matrix (fRest or fMoved) will do what you want -- or you might find it makes sense to use a Matrix to accumulate the rotations and translations.
as for vectors that don't start from {0,0} ... well at the risk of totally misunderstanding what you're thinking here ... an LM_Vector2 has an x value and y value, so if you want your vector to start at {X0, Y0} and go to {X1, Y1} you can store those two vectors exactly like that - or if you have a vector that is {dX, dY} wrt {0,0} then X1=X0+dX, Y1=Y0+dY - either store dX,dY and remember to add - or add and store the result
خیام اگر ز باده مستی خوش باش
با ماهرخی اگر نشستی خوش باش
چون عاقبت کار جهان نیستی است
انگار که نیستی چو هستی خوش باش
با ماهرخی اگر نشستی خوش باش
چون عاقبت کار جهان نیستی است
انگار که نیستی چو هستی خوش باش