1. Question on Node rotations

Hi, I am writing a Collada viewer, and was wondering about rotation elements that are children of nodes.

Using the Seymour_triangulate.dae file as an example, it contains the following snippet:

<node id="l_hip" name="l_hip" sid="l_hip" type="JOINT">
<translate sid="translate">0.450181 0.049889 0.340342 </translate>
<rotate sid="jointOrientZ">0 0 1 -81.9269 </rotate>
<rotate sid="jointOrientY">0 1 0 -3.10948 </rotate>
<rotate sid="jointOrientX">1 0 0 0 </rotate>
<rotate sid="rotateZ">0 0 1 42.183 </rotate>
<rotate sid="rotateY">0 1 0 -5.78704 </rotate>
<rotate sid="rotateAxisX">1 0 0 -150 </rotate>

I have two questions:

1. I'm assuming the rotations need to be done in order, but why are there two different rotations about each of the x, y and z axes, and what space are these axes defined in?

2. Do I need to do the translation before the rotations?

2. Nevermind part 2, the specification specifically mentions the rotations are without any translation.

3. <translate> and <rotate> cumulates in the order they appear.
Just like a matrix stack in a rendering API.

4. Originally Posted by Jaytan
Nevermind part 2, the specification specifically mentions the rotations are without any translation.
Actually I find this a very confusing statement in the spec.

Basically the order matters, and you should use the 'getContents' to iterate over the proper order of transforms (<lookat>,<matrix>,<rotate>,<scale>,<scew>,<transl ate>) and build the resulting matrix, using post-multiplication (as if each individual transform element first was converted to a matrix).

According to the Collada 1.4.1 spec:
Rotations change the orientation of objects in a coordinated system without any translation.
Translations change the position of objects in a coordinate system without any rotation
I wonder what this 'without translation' part in the <rotate> and 'without rotation' in the <translate> part is refering too?
Those transforms act in a local coordinate system, and they concatenate in order, so they include all translate's, rotate's and others (scale etc) previous applied in all the transforms in this node's transform stack. In a node-hierarchy, they also include all transforms (rotates,translates etc) from its parent... That's why 'without translation' and 'without rotation' is confusing: the local coordinate system does include translation/rotation.

Erwin

5. Originally Posted by erwin
According to the Collada 1.4.1 spec:
Rotations change the orientation of objects in a coordinated system without any translation.
Translations change the position of objects in a coordinate system without any rotation
I wonder what this 'without translation' part in the <rotate> and 'without rotation' in the <translate> part is refering too?
It's just saying that the respective element does not contain information that causes a transformation other then what is expected.
Originally Posted by erwin
Those transforms act in a local coordinate system, and they concatenate in order, so they include all translate's, rotate's and others (scale etc) previous applied in all the transforms in this node's transform stack.
Yes, in other words they define the local coordinate system.

Posting Permissions

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