# Thread: Transformation Matrices for Nodes Elements?

1. ## Transformation Matrices for Nodes Elements?

Hello

I believe I have most of my animation loading code working thus far. But I am having a bit of trouble with creating the transformation matrices from each <node> of the hierarchy of <node> of type "JOINT" . Here is the hierarchy.

Code :
```      <node id="BONE_Root" name="BONE_Root" type="JOINT">
<rotate sid="jointOrientX">1 0 0 -90.000000</rotate>
<rotate sid="rotateY">0 1 0 -0.000027</rotate>
<rotate sid="rotateX">1 0 0 -90.000003</rotate>
<scale sid="scale">0.025400 0.025400 0.025400</scale>
<node id="BONE_Transform" name="BONE_Transform" type="JOINT">
<translate sid="translate">0.000011 -20.000000 0.000006</translate>
<rotate sid="rotateZ">0 0 1 0.000027</rotate>
<rotate sid="rotateY">0 1 0 4.085627</rotate>
<rotate sid="rotateX">1 0 0 90.000009</rotate>
<translate sid="translate">-0.000000 -0.000011 58.740158</translate>
<rotate sid="rotateZ">0 0 1 4.085628</rotate>
<rotate sid="rotateX">1 0 0 0.000007</rotate>
</node>
</node>
</node>```

I have been able of retrieve all the values for each node, but for each node, I dont know how I should go about multiplying its transformation data to create the Joint's transformation matrix. Can someone please show me how?

I Appreciate the help.

2. ## Re: Transformation Matrices for Nodes Elements?

The COLLADA spec says that the transformation elements can be converted to (column) matrices and post-multiplied in the order they are given within each <node> to compose its local coordinate system.

So, for example: [BONE_Root] = [jointOrientX] [rotateY] [rotateX] [scale]

3. ## Re: Transformation Matrices for Nodes Elements?

I am using directX on my code so I need to build a row major tranfomration matrix from these <node> element transforms ( I transpose the matrices of the inverse bind matrices to make thme row major also. ). So I take each of the <node>'s tranformations and use them to create matrices for each one. For example,

[jointOrientX] becomes its own matrix
[rotateY] becomes its own matrix
and so on for each transform.

When I have turned each transform into a matrix. I concatenate them like you posted in your example below.

[BONE_Root] = [jointOrientX] [rotateY] [rotateX] [scale]

However, there is something wrong in my doing here becuase I am not getting the correct results on the asset skeleton when it is loaded into my 3d game. Perhaps this has to do about the post multiplication you mentioned. I dont quite understand what this means. Can you elaborate that?

Thanks!

4. ## Re: Transformation Matrices for Nodes Elements?

post-multiplying with column-major matrices produces the same result as pre-multiplying with row-major matrices

#### Posting Permissions

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