I think I found the solution. I've built a node hierarchy and actually computed the inverse transformation matrix for all the parents, and multiplied it by the current node transformation. That way the node position it's correct. Hope this helps some other folks...
I've seen quite some posts about this matter but couldn't find a solution. I'm creating a mesh, setting up a node hierarchy, but the problem is how to assign node positions correctly. I think I understood that a child node doesn't start at identity matrix, but it inherits parents transformations. So I thought I'd scan the hierarchy, accumulate all the matrix transforms, and multiply. Say I need to set correct position for the hand node, I'd go with this pseudo-code: handNodeMatrix = ShoulderMatrix...
I'm a bit confused and I'm not sure if the following scheme can be achieved. Basically I have a tree geometry, where branches are an aiMesh, and leaves another aiMesh. This because I need aiMaterial to be specific to each, and per documentation, one mesh only supports one material. So, I'd like to have a hierarchy as the one attached, where an aiNode actually commands the related branch/leaves meshes. I don't need the leaves to have any bones (they would simply follow the branch parent transformation),...
Thanks Kim, that actually helped. I now have a working setup for assimp assets. I'm still confused about an aspect of creating a node hierarchy but I'll open another thread about it. Cheers
Hi folks, I'd like to ask some guidance or an example of how you'd, for an existing mesh, create and initialize a couple of bones and weights. I've tried something very simple like this: auto pMesh = myScene->mMeshes[0]; myScene->mMeshes[0]->mBones = new aiBone*[1]; myScene->mMeshes[0]->mBones[0]->mName = "bone 0"; and last line is actually crashing the application. Thanks for any help and suggestion.