View more

View more

View more

### Image of the Day Submit

IOTD | Top Screenshots

### The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

# [Assimp] Getting bind pose bone positions

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

4 replies to this topic

### #1stu_pidd_cow  Members

Posted 04 February 2014 - 02:19 AM

I'm trying to get my head around animation and Assimp. I'm trying to just get the bone positions in bind pose (no animation or anything like that). According to various sources, I should be able to use aiBone::mOffsetMatrix. The way I am doing it is (psuedo code):

MthVector4 v(0.0f, 0.0f, 0.0f, 1.0f);
MthMatrix invOffset = mOffsetMatrix;
invOffset.Inverse();
invOffset.Transform(v, v);
pos = (MthVector3&)v / v.w;


pos should give the position in model space, right? I've spent a while fiddling around with this stuff for a while but nothing looks right at all. So what is the correct way to do this?

Thanks.

### #2stu_pidd_cow  Members

Posted 04 February 2014 - 05:18 PM

Ok, maybe a clearer question would be: What are aiBone::mOffsetMatrix and aiNode::mTransformation, what is the difference and when/how should I use them?

Thanks.

### #3uglybdavis  Members

Posted 15 February 2014 - 11:16 PM

To my knowledge, assimp does not store bind pose.

The skeleton you have is stored in whatever frame 1 is.

The offset matrix is what you need to multiply a vertex (taking the joint's weight into account) by in order to get it into the bone space of frame 1.

I love assimp, but i can't stand the datastructures / orgonization / matrix handedness they chose.

### #4DTR666  Members

Posted 16 February 2014 - 09:56 AM

I got headache when I have worked on skinning with Assimp. Uglydavis has right, no bind pose.

I had to take a look to Assimp model viewer source code to get it working.

The bone matrices should be computed like that (or reverted depending of your matrix convention):

BoneWorldTransform * BoneOffsetMatrix * InverseRootNodeWorldTransform

Root node, is the root node of the aiScene (not the skeleton root node).

Hope this helps !

Edited by DTR666, 16 February 2014 - 04:03 PM.

----

www.winthatwar.com

www.insaneunity.com

@InsaneUnity

@DTR666

### #5Buckeye  GDNet+

Posted 16 February 2014 - 03:32 PM

What you're doing appears to be fine. If you need more help, you'll have to provide more information than "nothing looks right."

I'm not particularly familiar with Assimp, but, as mentioned above, the offset matrix transforms a position in root node space to bone space. For example, assume a mesh vertex is positioned (0, 20, 5) with respect to the root node. If a bone is positioned at (0, 19, 4) with respect to the root node, the offset matrix will transform the position to ( 0, 1, 1) (ignoring rotations and scaling).

According to the Assimp docs, mTransformation is a bone's orientation with respect to its parent bone.

Edited by Buckeye, 16 February 2014 - 03:45 PM.

Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.

You don't forget how to play when you grow old; you grow old when you forget how to play.

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.