# Z Axis Anomaly?

I’m working on understanding rigging at a very basic level and while working through a tutorial on foot/leg rigging, I came across something weird. The logic is… let’s say, unusual.

If anyone can explain how and why this makes sense, please do.

[ATTACH=CONFIG]173771[/ATTACH]

In the top armature, the Z axis of the selected bone points down; in the bottom armature, the Z axis points up. Yet both bones have a Roll of zero (0).

What’s really interesting to me is that rotating bones doesn’t seem to have any affect on the roll. Rotate a bone 180 degrees around the X axis and the Z axis still points in the same direction as before you started.

Seriously, if anyone can explain this, please do.

-Ron T.

That is because that ‘roll’ value is related to rotating the bone based on a quaternion. “Quaternions” are odd beasts, they are not intuitive and rely on the mathematics of them ‘just working’ for doing 3d rotations (http://en.wikipedia.org/wiki/Quaternion).

What matters in this case is that ‘roll’ is related to fixing a side effect of defining bones with this system. The bones are actually defined by a vector running from the head of the bone to the tail. Depending on where the ‘tail’ is put, it not only rotates the object around the ‘head’, but also twists it around the axis of the bone itself. The ‘roll’ undoes this twisting effect.

-Place your 3D cursor at (0,0,0)
-Go into ‘front’ view (num pad 1)

• Go into Edit mode
• Rotate the bone 90 degrees about the Y axis.

You should now see the roll has changed to 90. At a rotation of 45 degrees the ‘roll’ is 45. This is undoing the ‘twist’ along the bone axis so that the same face on the bone points toward you as you rotate the bone.

There is not a good intuitive way to understand what is happening with the roll. All you can do is go back to the math of the quaternion system and understand why that puts roll in. This math is purely abstract so that is all you can say about it.

You’re right, Kastoria, that is a real mind-bender. Math has always been my worst subject, so I won’t go any further with it. Likely, what you’ve written above is enough for me to know.

Thank you for explaining.

I guess as long as I know it’s there, I can make sure I do something to compensate when some weirdness arises from it. This all started when I reproduced two separate rigs based on a tutorial and only one of them worked the way it was supposed to. It took hours to find the problem; the images I included above pretty much sum up what the difference was.

Now that I know to watch for it, it shouldn’t be a problem and your explanation convinces me to treat it like a black box.

Many thanks.

-Ron T.

When in edit mode for an armature ctrl +n or “recalculate bone roll” let’s you automatically fix a lot of issues with bone roll.

Thanks again, Kastoria. Very handy tidbit of info.