# Using XYZ Rotation Order for Ball Joint Constraints

Posts: 19
edited December 1969

Hi. Have not been able to find any explanation on exactly how the XYZ rotation order influences the XYZ constraints that can be set for a ball joint selected from the Motion tab/constraints drop down menu. I was working with a robotic structure, using the rotation tool to rotate a leg from the hip along a specific axis and getting unexpected results such as the leg suddenly reversing it's rotation direction on releasing the mouse or not being able to move the leg all the way to the end range of its set rotation. I changed the XYZ rotation order and everything works perfectly but I'm not sure I understand why. Is it something to do with setting the XYZ rotation order so that the axis allowing the greatest range of motion is first, and the one with the least range (or locked altogether) is last? (I'm currently running Carrara 6 Pro.)

• Posts: 19,332
edited December 1969

The first axis is the twist axis, which behaves differently from a bend axis. Usually it will be the axis that points along the bone.

The second and third axes are the bends - because the third axis is rotated by the second, which can lead to its not being able to achieve the desired result, it's best to have the bend that is most likely to hit a right angle, or to get closest, last. That way you are least likely to get gimbal lock, where two axes end up on top of each other and so you can't make any rotations in the third dimension.

• Posts: 19
edited December 1969

Aha! Thanks for shedding some light on the problem I was dealing with and for identifying it as gimbal lock (read a little further about that online). So now, from your explanation, I understand to order my twist axis first (depending on the orientation of my linked object) and keep the axis most likely to achieve a bend of 90 degrees (or greater, I assume) last.