I need to combine multiple matrices to do skeletal animation in c++.
I already got the following matrices:
- Bind Shape Matrix from a COLLADA file.
- Bone Matrix for every bone from a COLLADA file.
- Bind Pose Matrix for every bone from a COLLADA file.
- Inverse Bind Pose Matrix for every bone calculated.
- Frame Matrix of every frame per bone of an animation from a COLLADA file.
Let's call these matrices:
- bindShapeTrans (XMFloat4X4)
- localBoneTrans (vector of XMFloat4X4)
- bindPoses (vector of XMFloat4X4)
- invBindPoses (vector of XMFloat4X4)
- animations (vector of vector of XMFloat4X4)
Now I have to create an array of matrices out of these to pass to my vertex shader, which uses it to calculate the final positions of the vertices considering their weights.
And here I got lost. I already read a lot of tutorials, but they all say different things about the order to combine the matrices. They also use different names for the matrices and now I'm totally confused.
So, how do I have to combine these matrices to get the correct final matrices?
Thank you for your help.
frameMatrix * invBindPose
for every bone, every frame. Maybe the other way round, depending on your math API. Do the bone matrices differ from the bind pose matrices? – Nico Schertler