I'm trying to get an animation playing in a DirectX program that I wrote. I using the FBX SDK to get the Mesh data.
I have an animation working. It is very simple Idle Animation and it works perfectly. I have another animation with the same mesh but the mesh really looks weird.
I will attach pictures of both the animations. The animation that is not working is a more complex animation than the idle animation. The way I'm calculating my vertex position for the skinned mesh is by sending an array of "lerped" matrices (each matrix in the array is for each joint in the mesh) and also another array of matrices for the joints in the bind pose. The bind pose matrices are inversed.
In my vertex shader, I multiply the vertex position by the inversed bind pose matrix and then multiply the "lerped" matrix (i.e. the matrix I calculate for a joint to transition between keyframes) by the weight to get a new position.
(Also, there is nothing wrong with the mesh)
I'm not sure where I'm going wrong. If I have missed any details please let me know.
Edit: On further inspection I think the other animation is also not correct but it just so happens that it has minimum movement and therefore looks right.
Good:


Bad:



Aucun commentaire:
Enregistrer un commentaire