Advertisement

Setting bone in skeleton from world transform

Started by June 29, 2021 06:36 PM
2 comments, last by h3ro 3 years, 5 months ago

Hallo,

I am struggling more with this than I would like to admit. I am trying to move a bone from skeleton A onto the position of a bone in skeleton B, but the problem can be simplified down to setting the transform of a bone from a world transform.

I know I really should show some code, but I fear that showing my code is more confusing the useful, as I am even confusing myself at this point. How do I convert a world transform into a local space transform of a bone?

h3ro said:
I am struggling more with this than I would like to admit.

That's a pretty common experience, i guess.

To convert between local and world space, you calculate the inverse of the transform matrix.
To get the transform relative to a parent bone, there are two main uncertainties: Multiplication order, and witch of the two matrices to invert.

So i always trial and error 4 options until it works. It's dumb, but because different math libs have different conventions, i gave up trying to do better. It's forgotten too quickly again after working on something else.

Not sure if this helps… ; )

Advertisement

You are perfectly right. I was over complicating this.
Basically all I needed was:

* Compute world pos of bone in skeleton A
* Set bonepos in local space for skeleton B by taking the worldPos of A and multiplying it with the inv of the parent bone.

Thanks for the input!

In case anyone is interested, I am using it to map meshes between skeletons and modifying the mesh so it better fits. Works like a charm! Left is human skeleton, right is super human skeleton. Notice the scale and posture change

This topic is closed to new replies.

Advertisement