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:
Maybe you can tell me what im doing wrong.. i just cant find the fault.Code :if( patentBone != NULL ) trMatrix = boneMatrix * parentBone->trMatrix; else trMatrix = boneMatrix; vertexTransformMatrix = offsetMatrix * trMatrix;
Thanks for all helpful answers!