I all,
I’m trying to load a skeleton, but I have some probleme with the matrix.
My test model is a box, with 3 bones :
Length = Width = 10
Height = 20
I exported this with ColladaMax and my matrices are:
<bind_shape_matrix>
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
</bind_shape_matrix>
<float_array id="Box01-mesh-skin-bind_poses-array" count="48">
0 0 1 0
-1 -0.000002 0 0
0.000002 -1 0 0
0 0 0 1
0.000000 0.000000 1 -10
-1 -0.000002 0.000000 -0.000008
0.000002 -1 0.000000 -0.000002
0 0 0 1
0.000000 0.000000 1 -20
-1 -0.000002 0.000000 -0.000006
0.000002 -1 0.000000 -0.000000
0 0 0 1
</float_array>
<node id="Bone01-node" name="Bone01" sid="Bone1" type="JOINT">
<translate>0 0 0</translate>
<rotate>0.577351 -0.577349 0.577351 -240</rotate>
<node id="Bone02-node" name="Bone02" sid="Bone2" type="JOINT">
<translate>10 0.000004 0.000001</translate>
<node id="Bone03-node" name="Bone03" sid="Bone3" type="JOINT">
<translate>10 -0.000002 -0.000002</translate>
</node>
</node>
</node>
To load the node matrice I do:
TranslationMatrix * RotationMatrix
To load a binding pose matrix I do:
InvBindMatrix = Matrix.Transpose()
(Transpose because I’m in a row matrix, like Direct3D)
I did not modify the bone position/rotation since the binding. So I presume that :
Bone2Matrix * MBone1Matrix = Bone2.InvBindMatrix.Inverse() = the absolute Bone2 matrix transform
In my code, Bone2.InvBindMatrix is
0 -0 1 -0
-1 0 -0 0
-0 -1 0 -0
-0 0 10 1
-0 -0 1 0
-1 0 -0 0
-1 -1 -0 0
-0 -0 10 1
Can someoune tell me where I’m wrong ? Loading a quaternion ou a matrix ? My multiplication order ?
Thank you very much