Collada Skinning HowTo..?

Hi there,

im trying to implement an data conversion from an existing collada library to my engine. The skinning in my engine was alwals working perfectly, using the data of my own X-File parser. I think the skinning-system which collada is using is the same, but there must be some differences between the offset matrices or in the usage of the orientation/rotation data. What im doing is this:

-I adapt the joint hierarchy in my bone hierarchy
-Out of the translation, jointOrient and rotation data of a joint, i generate a transformation matrix (called boneMatrix) for each bone.
-The offset matrices from the morph-skin-bind-poses-array are saved for every bone as well

The generation of the boneMatrix works like this:
-I add the translation to an identity matrix
-For each Rotation (jointOrientX, jointOrientY, jointOrientZ, rotationX, rotationY, rotationZ), i generate a quaternion.
-All the quaternions are multiplied to a single quaternion, which is added to the matrix

With this data, im skinning my model like this:
For each bone:

if( patentBone != NULL )
trMatrix = boneMatrix * parentBone->trMatrix;
trMatrix = boneMatrix;

vertexTransformMatrix = offsetMatrix * trMatrix;

Maybe you can tell me what im doing wrong… i just cant find the fault.
Thanks for all helpful answers! :smiley:

I’m not perfectly sure if here is your problem but you are doing something a little wrong. In COLLADA you need to treat the node’s transforms like a matrix stack. The fact that you are reading and concatinating all of the <translate> elements first can give you wrong results. The order of transforms is important. What you should do is multiply them together in the order they are in the document. ie, rotateX rotateY scale translate rotateZ -> create a matrix for each transform -> post multiply the matrices together.

Try that out. I hope it fixes your problem.