I'm integrating an animation framework to Irrlicht. It provides a global matrix and I need to convert to local matrix for Irrlicht to use.
Because the local matrix from the 3rd-party doesn't work.
Have anyone done this before?
Convert world transform matrix to local for joint
Convert world transform matrix to local for joint
Re-creating Irrlicht with Vulkan: http://irrlicht.sourceforge.net/forum/v ... =6&t=52404
-
- Competition winner
- Posts: 688
- Joined: Mon Sep 10, 2012 8:51 am
Re: Convert world transform matrix to local for joint
I assume you're talking about the SkinnedMesh. Line 818 of CSkinnedMesh.cpp is CSkinnedMesh::calculateGlobalMatrices(). Here you'll see that the joint's global matrix is calculated by multiplying it's parent global by the local. So to get the local, you have to do it in reverse: Multiply the global matrix for the joint that you have by the inverse of the parent joint global. You'll have to set the parent joint global first (if there is a parent joint).