Sign in to follow this  
CaossTec

Getting the bind pose on Skinned mesh

Recommended Posts

CaossTec    143
I had successfully loaded a skinned mesh, but as I don't want to use the ID3DXAnimationController to animated it, I had extracted all the RST keyframes out of the animation sets so I can interpolated them and animate the model by myself. Well, in fact I had only extracted the Rotation component of the keyframes since Scale and Position will remain constant in most character animations (e.g. an arm will not get any bigger). Being the matrices formed by that Scale-Positions the bind pose. But the problem I'm facing is that I indeed need to know the matrices of the bind position in order to render the model correctly given the bone rotations. That Scale-Position components can be extracted from one Keyframe of any of the animation sets. But if I load a .x with a skinned mesh and no animation sets attached; where I can get the Scale-Position components of the bind pose?

Share this post


Link to post
Share on other sites
You get the bind pose using ID3DXSkinInfo::GetBoneOffsetMatrix and equation (3) below.
Definitions:

Li is the local transform of bone i.

Bi is the bind-pose local transform of bone i.

Ci is the combined transform of bone i.
Cp(i) is the combined transform of the parent bone of bone i.

Mi is the offset transform of bone i.
Mp(i) is the offset transform of the parent bone of bone i.

Fi is the final transform of bone i.
Fp(i) is the final transform of the parent bone of bone i.

Equations (1) and (2) are the standard skinning equations (ignoring bone weights and the weighted summation):

(1) Ci = Li Cp(i)

(2) Fi = Mi Ci = Mi Li Cp(i)

Equation (3) expresses a bone's bind-pose local transform as the product of the bone's inverse offset transform and the parent's offset transform.

(3) Bi = Mi-1 Mp(i)

Substituting Bi for Li in equation (2) results in a bone having the same final transform as its parent:

(4) Fi = Mi Bi Cp(i) = Mi Mi-1 Mp(i) Cp(i) = Mp(i) Cp(i) = Fp(i)

Suppose Croot = Mroot = I. Then setting Li = Bi for every bone in the skin's hierarchy results in every bone having the same final transform Fi = I. That satisfies the bind-pose condition.


[looksaround] Or I could be wrong.



[Edited by - Happy Noodle Boy on July 24, 2005 5:36:47 AM]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this