Jump to content
  • Advertisement
Sign in to follow this  
SteveDeFacto

Assimp: Get bone matrix?

This topic is 2506 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

To get a bone's global transform matrix I am using the following code:



aiNode* bnode = scene->mRootNode->FindNode(scene->mMeshes[m]->mBones->mName);
aiMatrix4x4 GlobalTransform = bnode->mTransformation;
aiNode* parent = bnode->mParent;
while( parent->mParent != scene->mRootNode )
{
GlobalTransform = parent->mTransformation * GlobalTransform;
parent = parent->mParent;
}
bone->matrix = Ovgl::MatrixTranspose((Matrix44*)&GlobalTransform)* MatrixRotationX(1.57f);


This works fine, however, the nodes are transformed to their last animation position. It does not make sense to me why the animations would be applied to the node's transformation? To fix this I will have to create very complex code. I was wondering if there was a way I can just get the bone transformations at their starting positions instead?

Share this post


Link to post
Share on other sites
Advertisement
I was wondering if there was a way I can just get the bone transformations at their starting positions instead?[/quote]
Do you mean the bind-pose? You may try to experiment with aiScene->aiMesh->aiBone->mOffsetMatrix.
Assimp themes are actual for me now too.

Share this post


Link to post
Share on other sites

I was wondering if there was a way I can just get the bone transformations at their starting positions instead?

Do you mean the bind-pose? You may try to experiment with aiScene->aiMesh->aiBone->mOffsetMatrix.
Assimp themes are actual for me now too.
[/quote]

Yes, that is what I was meaning. What do you mean by, "Assimp themes are actual for me now too? "

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!