An order of transformations for nodes

Good day,

Collada specification document says that node’s transform elements should be converted to matrices and post-multiplied in the order they are specified to compose the final transform.

Let’s say we have a node:


<node id="joint3" name="joint3" type="JOINT">
          <translate>2.000000 0.000000 0.000000</translate>
          <rotate>0 0 1 -90.000000</rotate>
          <rotate>0 1 0 0.000000</rotate>
          <rotate>1 0 0 0.000000</rotate>
          <rotate>0 0 1 0.000000</rotate>
          <rotate>0 1 0 0.000000</rotate>
          <rotate>1 0 0 0.000000</rotate>
          <rotate>0 0 1 0.000000</rotate>
          <rotate>0 1 0 0.000000</rotate>
          <rotate>1 0 0 0.000000</rotate>
          <scale>1.000000 1.000000 1.000000</scale>
</node>

How do I know the exact transformation order using the DOM API? It seems it provides me translation/rotation/scale transform arrays separately with no way to determine the original order…

There are two ways to go about getting that information.

The contents array stores the children in order, so getContents returns an array of daeElements. You can loop through that array and call element->getTypeName() to see what type of element it is and cast appropriately.

There is also a method on daeElement getChildElements( daeElementRefArray &array ) where array is the output. It will append all the children onto the array in the correct order. Then you can do the same as above to get the children you need.

-Andy

Thanks a lot, alorino, it worked out.