• Advertisement
Sign in to follow this  

ms3d key frames and local positions/rotations relative to what ?

This topic is 4515 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all please execuse me for the long question, I meant that to make things more clear: skeletal animation in ms3d file is based on transforming model vertices by a skeleton of joints. the absolute transform of a joint is the product of its relative transform with the absolute transform of its parent joint. I have no problem with the theory behind that. I was able to load the mesh. I was also able to animate the model but there is something wrong going on. in summary here is what I did: 1- I calculated the absolute transform for each joint assuming the provided translation and rotation in ech joint as its relative translation and rotation. 2- I used the inverse of the above transform and transformed all the vertices to make them ready for transformation in the animation function 3- in the animation function we need to calculate the new joint absolute transforms, this is done by interpolating the key translations and rotations. her is the confusion: I need to know relative to what these key translations and rotations are ? I tried to consider the interpolated translation and rotation as the current joint relative translation and rotation and based on that calculated the abs transform but this did not work. I tried to consider the joint initial rotation multiplied by the current interpolated rotation as the joint new relative rotation, similarly, I considered the joint initial translation added to the current interpolated translation as the new joint relative translation. this was able to animate the model but the animation was not 100% correct. I tried to use some test joints defined by me and was able to prove that the procedure I am using is correct so I am afraid I am not interpreting the keyframe informatin the right way. by the way, I was reading in the book focus on 3d models, the joint final transform is calculated as: no parent: (joint_local * joint_current_interpolation_matrix) if it has a parent: parent_matFinal * (joint_local * joint_current_interpolation_matrix) where joint_local is the joint initial relative transform I guess what I mentioned above is basically what the book mentioned I do not know what is going wrong ? any hints ? I passed by this on the web: // // Mesh Transformation: // // 0. Build the transformation matrices from the rotation and position // 1. Multiply the vertices by the inverse of local reference matrix (lmatrix0) // 2. then translate the result by (lmatrix0 * keyFramesTrans) // 3. then multiply the result by (lmatrix0 * keyFramesRot) // // For normals skip step 2. // // NOTE: this file format may change in future versions! // // - Mete Ciragan // in point 2, why the local matrix and not the absolute transform of the joint ? thanks allot

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement