Results 1 to 7 of 7

Thread: <node> transforms

  1. #1
    Junior Member
    Join Date
    Mar 2010
    Posts
    7

    <node> transforms

    Hello!

    I am working on a SceneGraph exporter and I found myself in trouble exporting a node's transform into a COLLADA-style translate-rotate-scale list. Usually, the elements in the transform list are multiplied in the reversed order to form the final ransform matrix, for example:
    <node>
    <rotate SID="r1" />
    <translate SID="t1" />
    <scale SID="s1" />
    </node>

    would result in the transform matrix s2 * t1 * r1. However, in the COLLADA-book I read that, in the countrary, in COLLADA matrices are being concatenated using the matrix-post multiplicaton, and in column-order. What does that mean? Do I have to multiply them in the order they are present in the <node>? How is my example to be interpreted in a mathematical way? Does "column-order" mean I have to transpose the matrices before multiplying them?

    Any help is welcome!

    Violin

  2. #2
    Senior Member
    Join Date
    Aug 2004
    Location
    California
    Posts
    771

    Re: <node> transforms

    Quote Originally Posted by violin
    Usually, the elements in the transform list are multiplied in the reversed order to form the final transform matrix
    That "usually" just means you are used to pre-multiplication of row-major matrices (as in C).
    Quote Originally Posted by violin
    However, in the COLLADA-book I read that, in the countrary, in COLLADA matrices are being concatenated using the matrix-post multiplicaton, and in column-order. What does that mean?
    It means COLLADA describes post-multiplication of column-major matrices.
    Quote Originally Posted by violin
    Do I have to multiply them in the order they are present in the <node>?
    Yes, after you convert them to column-major matrices. Note that only the <matrix> element is a matrix.
    Quote Originally Posted by violin
    How is my example to be interpreted in a mathematical way?
    Code :
    node matrix = (r1)( t1)( s1)
    ... where r1, t1, and s1 are column-major matrices.
    Quote Originally Posted by violin
    Does "column-order" mean I have to transpose the matrices before multiplying them?
    Only if you created row-major matrices to begin with.

  3. #3
    Junior Member
    Join Date
    Mar 2010
    Posts
    7

    Re: <node> transforms

    Thanks for the answer Marcus. I now understand how node transformation works in collada. I have one more question though - how do you interpret the rotations and translations as transforms in space? If you translate them into row-major matrices and pre-multiply them, each transform is consecutively applied to the object in its local space, with translations moving it away from the center and rotations rotating it according to its local frame. Is the COLLADA-way (with column-major postmultiplied matrices) the same, but in the reverse order?

    Violin

  4. #4
    Senior Member
    Join Date
    Aug 2004
    Location
    California
    Posts
    771

    Re: <node> transforms

    Yes its the same.

    In COLLADA, a <node> describes a place (local coordinate system), defined by its transform elements, into which things are instantiated, including more sub-places (nodes).

    You might want to read up about e.g. passive vs active transformations too.

  5. #5
    Junior Member
    Join Date
    Mar 2010
    Posts
    7

    Re: <node> transforms

    And here comes the sticking point - if the transform elements are to be read in the reverse order, this means the first transformation is the last one to be applied. How can this be a human-readable format for transformations, if you cannot figuratively imagine the transformation of the object by just reading the text? With row-major matrices you can, because each rotate/translate corresponds to exactly the same action (or passive transform, as described in wikipedia), applied to the object (or its current frame, respectively).

    I hope you understand the source of my confusion...

  6. #6
    Senior Member
    Join Date
    Aug 2004
    Location
    California
    Posts
    771

    Re: <node> transforms

    Perhaps this matrix discussion thread at gamedev.net will help you? Note that OpenGL and COLLADA specs share the same notation.

    There are uncounted tutorials on linear algebra on the web you can study to learn more.

  7. #7
    Junior Member
    Join Date
    Mar 2010
    Posts
    7

    Re: <node> transforms

    Quote Originally Posted by luli123
    what cad software or cad program is considered to be advanced/ high level/ challenging?
    Those which can read COLLADA files!

    I want to thank Marcus for the help. I solved my problem and I now understand how COLLADA transforms work. I study mathematics and have no problem with linear algebra - it was just the statement in the COLLADA specification that COLLADA is meant to be human readable. For me that means transforms in COLLADA should be readable for someone who has no idea about row-major matrices, or post-order multiplication But now I realize COLLADA is not made for that kind of people

    Cheers!

Posting Permissions

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