Help understanding GlobalInversedMatrix and animation
Posted: Wed Feb 07, 2024 5:37 pm
I'm trying to implement my own render/animation code and porting my existing logic which uses the irrlicht api. Currently my animation code produces gibberish and I'm trying to get better understanding of animation math and how to use the B3D keyframe data I have
I'm confused about how irrlicht animates. In the CSkinnedMesh::skinJoint function, it has this code
I don't understand the role of GlobalInversedMatrix. When mesh is loaded, CSkinnedMesh::finalize is called. And it calls CSkinnedMesh::calculateGlobalMatrices, which has this code
so it looks like GlobalInversedMatrix is the inverse of the joint's initial pose matrix? when this is multiplied with the animated pose matrix, what effect does that have? what does the inverse matrix represent in this context? insights about this would help me.
I'm confused about how irrlicht animates. In the CSkinnedMesh::skinJoint function, it has this code
Code: Select all
core::matrix4 jointVertexPull(core::matrix4::EM4CONST_NOTHING);
jointVertexPull.setbyproduct(joint->GlobalAnimatedMatrix, joint->GlobalInversedMatrix);
jointVertexPull.transformVect(thisVertexMove, weight.StaticPos);
Code: Select all
joint->GlobalMatrix = parentJoint->GlobalMatrix * joint->LocalMatrix;
joint->GlobalInversedMatrix = joint->GlobalMatrix;
joint->GlobalInversedMatrix.makeInverse();