1
\$\begingroup\$

I don't fully understand the transformation hierarchy used by ASSIMP.

  1. According to the docs (http://assimp.sourceforge.net/lib_html/structai_node.html) an aiNode's transformation is relative to its parent. Does this mean I need to concatenate its parents (and their parents) matrices with the nodes matrix to get the LOCAL matrix for the model? Or is the nodes transform already per-multiplied with all the parents, meaning transforming the nodes vertices by the nodes transform directly puts the vertices in the models LOCAL space (and not just the 'NODE' space)?

  2. Kinda same as 1) but does transforming the vertices with the aiNodes transform put it in the "bind pose"?

  3. What is the point of even having a transform per aiNode? Why not just pretransform all the vertices? From what I understand the counter-argument has something to do with animations... but each animation step already has its own position/scale/rotation!

Any help is much appreciated, I don't fully grasp the transform hierarchy which makes it hard to formulate good questions.

\$\endgroup\$
0
\$\begingroup\$

To answer your questions:

  1. Yes you need to multiply the child node's transform with the parent node's transform to obtain the final world transform for the mesh at that node. You basically have to walk down the hierarchy to the child nodes, multiplying all the transform together to get the transform for each child node's mesh.

  2. No, transforming the vertices with the aiNodes transform does not put it in the "bind pose".

  3. It is not pre-multiplied so that when you change the transform of the parent nodes, the child node's final transform changes automatically with them (as you are multiplying with the parent's transform, thus applying it on the child node). This means if for example you have a parent car mesh, which have child wheel meshes, changing the transform of the car mesh would automatically affect the transform of the wheels and the wheels would move with the body. If it were'nt the case, and if the transformed were pre-multiplied, then either you would have to transform the wheels separately and make them move, or the wheels stay where they were and only the body moves away, which you might not want. Also, as Syntac_ mentioned, it gives you more flexibility in regards to what you want to do with the hierarchy and how you want to build the Scene graph. Have a look at this as it explains this stuff better.

\$\endgroup\$
0
\$\begingroup\$

You must multiply each node by it's parent's transform (and the parent's node parent's transform, etc), to get the local transform for that node.

Why is it not pre-multiplied? Because it gives you the option to rebuild the hierarchy at run-time after applying transformations to any point of the hierarchy.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.