FBX skeleton animation - need help

This topic is 2818 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

If I’ll define : pCluster->GetTransformLinkMatrix(BoneL); © BoneL = ParentW.GetInverse() * BoneL; equation (A) will hold, but then BoneL is not in local space.

?

Share on other sites
If the skeleton is working but your skin is not moving maybe your bindmatrices are wrong.

I can show how I get my matrices from my FBX loader.

1. Get all bones from an animation for example
KFbxXMatrix matrix = node->EvaluateLocalTransform(time) * NodeHelper::getNodeTransform(node);

2. Then bine pose matrices for each corresponding mesh deformation cluster
 KFbxXMatrix globalMatrix; lCluster->GetTransformMatrix(globalMatrix); KFbxXMatrix geomMatrix = NodeHelper::getNodeTransform(mesh->GetNode()); globalMatrix *= geomMatrix; KFbxXMatrix skin; lCluster->GetTransformLinkMatrix(skin); skin = globalMatrix.Inverse() * skin; skin = skin.Inverse(); bindMatrixArray[index] = skin; 

3. Then i build the hierarchy with the node transforms
absoluteNodeMatrix = localSpaceMatrix * parentMatrix;

4. Apply the inverse bind pose matrix
for (unsigned int i = 0; i < bones; ++i) { ShaderReadyBoneMatrix = bindMatrixArray * absoluteNodeMatrix; }

5. Model renders fine

: )

Share on other sites
Hi,

actually I'm interesting on how you got the joint local, and the parent matrices which holds:
BoneWorldMatrix = BoneLocalMatrix * ParentWorldMatrix.

my intention is to have the BoneWorldMatrix multiplied by KeyFrameMatrix.
KeyFrameMatrix matrix may be the identity if no animation applied, in that case, the skeleton needs to be
and the bind pose. Else, it should be animated.

Still I did not mange to get it right.

Share on other sites
If you still not have solved the problem, I can show how I load the matrices

1. first find the root node of the skeleton
if (node->GetSkeleton()) { ... }

2. then build the hierarchy, I do it with a recursive function
for (int i = 0; i < node->GetChildCount(); ++i) { parse(node->GetChild(i), childParent); }

3. then as previously mentioned I get for each bone node its local matrix
KFbxXMatrix localBoneMatrix = node->GetScene()->GetEvaluator()->GetNodeLocalTransform(node); // or use node->EvaluateLocalTransform(time) for animations

4. and you know which bones are parent bones since you loaded them in the correct hierarchy

• Game Developer Survey

We are looking for qualified game developers to participate in a 10-minute online survey. Qualified participants will be offered a \$15 incentive for your time and insights. Click here to start!

• 16
• 15
• 9
• 11
• 15