Skinning with FCollada

Hello everyone, I’m trying to get skinning working with some collada files, I’ve been using Fcollada to parse collada files for a while, but I can’t seem to get the skinning portion right.

The bind pose works fine, but when trying to integrate the animation curves everything goes wrong. I’m obviously misunderstanding something.

For the simple bind pose I’m doing the following:

For each joint:

		
MatrixF worldTransform = jointNode->getWorldTransform();
mJoints[i].jointTransform = worldTransform * mJoints[i].invBindPoseTransform * mBindPoseTransform;

The getWorldTransform() is coming from
FMMatrix44 m = fNode->CalculateWorldTransform();
at import time, It’s my understanding this is correct?

And then for each influence on each vertex:


Point3F p = bindPosition;
mJoints[jointIndex].jointTransform.mulPoint(&p);		
finalPos += p * weight;	

This all works fine, then I’m trying to get the animation matrices by using


	FCDSceneNodeTools::GenerateSampledAnimation(fNode);
	const FloatList kl = FCDSceneNodeTools::GetSampledAnimationKeys();        
	const FMMatrix44List ml = FCDSceneNodeTools::GetSampledAnimationMatrices();

But even grabbing the matrices on the first frame (0.0f) everything looks badly. I’m not sure how I’m supposed to plug the animation matrix with the previous joint calculations. I tried several approaches, none being perfect.

Hope someone out there is still using FCollada and can give me a helping hand :smiley:

Thanks for your time.

I have the same problem. My bind pose is fine, but when i’m trying to start an animation some of the matrices are not right. My animation is on the gpu with a shader. And the shader is correct. If i start the animation of the Seymour model on the l_hip it all works but when i start it on the r_hip the knee bends in the wrong direction. This is probably because the l_hip childrend doen’t have an animation. So i was wondering what is the equation for the childeren that have an animation or how do you build you own skin controller. I’m a little stuck here but i’m very close. I’m trying to make an exporter from maya, and get it done in OpenGL.

I know of a bug in FCollada where the animation matrix values are exported with a last (15th) value of zero causing bad animations. This value should be one (not zero).