Page 1 of 1

Armature bone orientations from physics joints

Posted: Wed Jun 29, 2011 12:18 am
by NetSavant
Hey Norbo / all,

I'm in the process of trying to rig up a ragdoll to an xbox live avatar - my plan was to manipulate the orientations of particular bones in the avatar's bind pose to match the orientations of joints that are modeled in the ragdoll (which won't be all of them - not gonna bother with fingers, etc.).

I'm creating the ragdoll entities and joints to match the bind pose - but I kinda hit the limits of my knowledge with how to extract the right orientations from those. For example the shoulders are a couple of BallSocketJoints - I can see there's a GetAngularJacobian() method that probably has the info I want in some form, but I get the feeling from initial web searches that I might need a lot of linear algebra studying before I understand what a Jacobian is.

So I thought I'd be lazy and ask here first - is there an easy way to extract an orientation matrix or quaternion to transform, say, an upper arm from its initial bind pose orientation to its current orientation?

Thanks!

-Luke

Re: Armature bone orientations from physics joints

Posted: Wed Jun 29, 2011 1:18 am
by Norbo
The constraints can be ignored when trying to compute the relative orientations. For reference, the GetAngularJacobian actually defines part of how the constraint computes relative velocities and transforms solution multipliers into impulses; it isn't necessarily helpful for determining the relative orientation.

Instead, I would just maintain a hierarchy of the entity 'bones.' Compare the relative orientation between the parent and child entities in the bind pose against the relative orientation between the parent and child entities in world space. The transformation between the two would be the goal. For quaternions, this can be obtained by conjugating one orientation and multiplying it against the other.

Re: Armature bone orientations from physics joints

Posted: Wed Jun 29, 2011 2:58 am
by NetSavant
Thanks Norbo - had that thought a bit after I posted, to use the world-space orientations of the parts relative to each other - that worked good.