The role of a bindMatrix in the Bone class


I'm trying to use JME bones and animation. I have a transform matrices for every bone in a skeleton, but these matrices

are for different coordinate system. When I apply these matrices to the skeleton without skin, I can see the correct animation. But if the skeleton has the skin, the animation is distorted. It looks like the skin rotates around bones.

I tried to change bindMatrix, and I was able to put skin back on the bone. But I dont understand, what the role of bindMatrix in the Bone system is. Can anybody provide an explanation? Thanks.

Are you using the jME built-in animation system in com.jme.animation? If so, then what I said might not be entirely accurate. I have written an animation system before for Ogre3D meshxml models (available under com.jmex.model.ogrexml).

The bind matrix is usually the matrix that transforms from bone space in bind pose to model space. This is used for skinning the verticies by multiplying the local bone animation transform by the bind matrix to get the "offset matrix" which is the matrix that transforms bind pose verticies to animation pose. To get the bind matrix, you need to know where each bone is in bind pose. If you know the bone's model transform when it's in bind pose, just take the inverse of that transform and you have the bind matrix.