Skip to main content
GameDev.net gamedev.net
🔒 Locked 🎮 Unity

Motion builder global rotations

Started by nemanjab17 Apr 17, 2019 at 8:24 PM 2 replies 6.1k views
Original Post
nemanjab17
nemanjab17

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!

Fulcrum.013
Fulcrum.013

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)
nemanjab17
nemanjab17

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

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.