0

I have a problem loading a collada mesh animation from file. The skeletons startpose is defined like this

<translate sid="translate">-0.01199548 0.1422831 -0.009544329</translate>
<rotate sid="jointOrientZ">0 0 1 0</rotate>
<rotate sid="jointOrientY">0 1 0 0</rotate>
<rotate sid="jointOrientX">1 0 0 0</rotate>
<rotate sid="rotateZ">0 0 1 -6.883375</rotate>
<rotate sid="rotateY">0 1 0 -10.62618</rotate>
<rotate sid="rotateX">1 0 0 8.255196</rotate>

I figure that the rotation should be done int the order that they are ordered here or am I missing something? I found out how the rotation works that is the first three values define the axis to rotate around and the last value how many degrees. But for some reason I get a very wierd result. I have the system working for a collada mesh which has a matrix reprensenting this same type of value.

1 Answers1

0

Just like you said, order of pseudo commands:

translateObject()
orientZObject()
orientYObject()
orientXObject()
rotateZObject()
rotateYObject()
rotateXObject() 

No other combinations possible. Matrix multiplication is not commutative.

This is working for me when parsing collada into webgl renderer. For matrix operations i use gl-matrix javascript library.

lukyer
  • 7,595
  • 3
  • 37
  • 31