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
Thanks for your time.