Motion builder global rotations

Started by
2 comments, last by nemanjab17 5 years ago

I am a beginner in computer graphics but i have solid understanding of linear algebra. I am trying to implement my own forward kinematics for a skeleton. I defined global and local translation vector in child-parent relationships but i am struggling with propagation of rotations from the node n to n+1, n+2 ...

I figured that motion builder uses XYZ rotation order. I created a matrix to transform child vector and "rotate it". 

But if i have 3 joints where 1st is parent to 2nd and 2nd is parent to 3rd, if i rotate 1st joint say (10,20,0) locally, i get accurate global position for 2nd and 3rd joint but if i have a local rotation of 2nd joint say (20,0, 0) on top of (10, 20, 0) for the 1st, my 3rd joint's position is wrong. I notice there should be some stacking so that i should probably do (10+20, 20+0, 0+0) for the second rotation but i am not sure why is that the case. 

If i could get some links or a book that will address this topic, i would appreciate it. Thanks!

Advertisement

To calculate global transformation of child you have to multiply a global transformation of parent by transformation of child that is  respective to parent. So 1st prent is always in global basis. production of its tranformation to 2ndgive  a global transformation of 2nd. now multiply it to 3rd and you have a global transformation of 3rd. It really works like a stack - for each child you multiply parent global position by its child local transformation then use it to process a childs of it child and so on for whole tree of basises. When some object change a local transformation, its global transformation and global transformations of each  subtree of its childs have to be recalculated.

 

#define if(a) if((a) && rand()%100)

Thank you @Fulcrum.013! It's as i was thinking. Thank you for the clarification, it makes perfect sence.

This topic is closed to new replies.

Advertisement