Original Post
Hello GameDev community,
I have run into an issue while animating my skinned meshes which is frustrating the socks off of me. The mesh renders perfectly fine in the bind pose position but once I try to animate it it gets distorted. I export the mesh from a Collada file to my own custom format through a custom exporter I built (which I double checked and works perfectly), than I bring the mesh into the engine and do the following for skinning (with no success):
First, I create the matrix palette by looping through all joints and calculating the skinning matrix as such:
For the root joint, I just multiply it's inverse bind pose matrix by the appropriate key frame transform matrix (no distortion in root bone).
For the remaining joints, I multiply it's transform matrix by it's parent's world matrix (which is the product of the transform matrices form the root joint to the parent joint), then multiply their product matrix by the joint's inverse bind pose (tons of distortions here).
Next, I loop through all vertices and calculate the new vertex position by taking the summation of the product of the vertex position and the appropriate skinning matrix multiplied by the joint weight.
Then I render.
Keep in mind that I'm not interpolating between key frames just yet, I'm just replacing the transform matrices exported from the node in Collada. I'm using C++ and DirectX by the way.
I hope that anybody can help me solve the problem or at least identify where it is.
Thanks in advance.
I have run into an issue while animating my skinned meshes which is frustrating the socks off of me. The mesh renders perfectly fine in the bind pose position but once I try to animate it it gets distorted. I export the mesh from a Collada file to my own custom format through a custom exporter I built (which I double checked and works perfectly), than I bring the mesh into the engine and do the following for skinning (with no success):
First, I create the matrix palette by looping through all joints and calculating the skinning matrix as such:
For the root joint, I just multiply it's inverse bind pose matrix by the appropriate key frame transform matrix (no distortion in root bone).
For the remaining joints, I multiply it's transform matrix by it's parent's world matrix (which is the product of the transform matrices form the root joint to the parent joint), then multiply their product matrix by the joint's inverse bind pose (tons of distortions here).
Next, I loop through all vertices and calculate the new vertex position by taking the summation of the product of the vertex position and the appropriate skinning matrix multiplied by the joint weight.
Then I render.
Keep in mind that I'm not interpolating between key frames just yet, I'm just replacing the transform matrices exported from the
I hope that anybody can help me solve the problem or at least identify where it is.
Thanks in advance.
