<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

That “usually” just means you are used to pre-multiplication of row-major matrices (as in C).

It means COLLADA describes post-multiplication of column-major matrices.

Yes, after you convert them to column-major matrices. Note that only the <matrix> element is a matrix.

Only if you created row-major matrices to begin with.

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

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.

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…

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.

Those which can read COLLADA files! :wink:

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 :slight_smile: But now I realize COLLADA is not made for that kind of people :smiley:

Cheers!