World matrix for 3D animation...
Hello,
I''m trying to render an animation exported from 3DSMAX (made my own file format with MAXscript). Everything works right if i use only translations, but i can''t make it work right with rotations, especially rotation centers.
So if i have the coords of the pivot point, a matrix for the world transformation of the parent mesh, the translation vector and the rotation quaternion for a given mesh at a given frame, how do i compute the new world matrix? I''m currently using a matrix stack, multiplying the top of the stack by the rotation-around-the-pivot and translation matrix, then pushing the new matrix in the stack. But rotation centers never are at the right place... why?
I do believe you need to translate the pivot to the origin first, then apply the rotation, and finally untranslate it back.
If you already knew that, then please forgive me.
If you already knew that, then please forgive me.
I use a function (D3DXMatrixAffineTransformation) which take a parameter for the rotation center (the pivot), so i don''t think the problem is there (thanks anyway!). In fact my rotation center isn''t where it should be only when its object is child of another rotating object.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement