3
\$\begingroup\$

I'm, trying to wrap my head around assimp to import some files, including fbx/obj etc.

Normally my experience tells me that I start at root node and then recursively load child nodes until I load the entire hierarchy. Assimp seems to have the same thing with each aiNode->mNumChildren so that part is clear to me.

What I struggle to understand is the meaning of each aiNode. As it turns out, each aiNode can be a camera/light/group/mesh/other.

This is where I get confused, if I debunk a node, and it ends up having mNumMeshes = 1 and mNumChildren = 2, that confuses me. It tells me that node is both group and a mesh at the same time. Not to mention if meshes >1 then I have no idea how to interpret it.

On top of that there appear to be extra "dummy" assimp nodes for internal purposes or something like that? They have specific name somehow, what do I do with that?

So far, I filter all meshes/camera/lights into separate arrays and I cross check each aiNode against the camera/light node to find out whether that node is a camera or a light. Groups can be identified by checking whether mNumChildren > 0, but meshes are black magic to me. Not to mention dealing with transforms...

aiCamera is also confusing as it appears to have a Matrix4x4 for position as well as up/lookat/ etc? I'm lost, which matrix/coords do I use, those in aiNode, or aiCamera?

How can I interpret this to re-create a proper hierarchy tree?

\$\endgroup\$

0

You must log in to answer this question.

Browse other questions tagged .