Recalculating bone roll - how does it work

I might have missed the explanation in one of @waylow 's videos, but when recalculating a bone's roll, to eg: global +Z, why does it not roll to 0 degrees?
What is Blender doing under the hood to give it's result?

Or should it not necessarily recalculate to 0 degs in every situation?

Here's an example where I'm setting up a new rig and placing my DEF bones.

Bone roll.png

I've just recalculated the DEF-Hand.L to Global +Z, and the resulting roll is 22 degrees. Why is it 22, and not 0? It might be a simple explanation, but it's caused me a few headaches just trying to understand it in a previous project when trying to set up a number of bones.

If I manually set the roll to 0, the bone isn't aligned with any global axis (as I've not told it to).

Bone roll 2.png

To summarise: What is Blender doing to determine the roll when recalculating to an axis - Ie, is it based off the location of the tail in relation to the head, or something else?

Am I possibly confusing the idea of recalculation with the idea of applying rotation of an object?

1 love
Reply
  • Wayne Dixon replied

    Hi Harris - excellent question.
    Honestly, the mathematics behind this is beyond me but here's the best way I can explain it (even though I'm not correct).

    Under the hood Blender uses quaternions which all get turned into Matrices (that store the position, orientation, and scale).

    We need to interact with that data in a more user friendly way, so those Matrices are translated into the head/tail position and bone roll in edit mode.

    However, with most things to do with mathematics, things don't translate the way you might first expect.

    For example, when you look at the default bone, there's mathematically 3 solutions to get the same orientation (when referring to the z axis for the roll)

    You can have that same orientation at a bone roll of 0, -360, or +360.
    However, there are also zero solutions to align the Z axis of the bone with the z axis of the world.  (that is the case when the y axis of the bone == the z axis of the world)

    But most of the time there are only 2 solutions like below (roll = + or - 180)


    I'm not sure if I mentioned how complicated rotations are 3d space ;)

    All of that is probably more confusing that it needs to be, but to answer your question most simply- you can think about it as speaking 2 different languages.

    Somethings are lost in translation.



    (This isn't correct but I hope it helps)


     



    2 loves
  • Martin Bergwerf replied

    Hi Harris,

    The fact is, that 3D rotations are quite complicated; Forget about Quaternions for the time being and simply look at what happens when you Rotate a Plane, that has been Rotated on the Z-Axis, on the Global X-Axis:

    BoneRoll_02.png

    Without touching the Local Y-Rotation (as in Roll) of the Plane, the Plane's Z-Axis is no longer aligned with the World's Z. So, to align the Z-Axis with the World's, you'd have to Rotate along the Local Y-Axis (changing its 'Roll').

    With Bones, it's basically the same (or the opposite if you want):

    BoneRoll_01.pngRotating this Bone on the Global X-Axis, will change the Roll, but the Bone's Z Axis will 'stay aligned' with the World.

    EDIT: this is not correct, it doesn't stay completely aligned to the World's Z-Axis.

    Rotating an Object in 3D, that is not oriented the same as the World, on one of the Global Axes, will most likely change the Rotation of all 3 Axes in a (Local) Euler Rotation.

    I hope this makes some sense, it's rather complicated to explain, but it's not like something magical is happening.

    1 love