Results 1 to 3 of 3

Thread: An order of transformations for nodes

  1. #1
    Junior Member
    Join Date
    Aug 2005
    Posts
    2

    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:

    Code :
    <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...

  2. #2
    Senior Member
    Join Date
    Aug 2005
    Location
    California
    Posts
    165
    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

  3. #3
    Junior Member
    Join Date
    Aug 2005
    Posts
    2
    Thanks a lot, alorino, it worked out.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •