View Full Version : order axis
03-15-2006, 09:16 PM
I really never got this but now I think I've got some headway to understanding what the axis order of bones refers to...
I hear that the axis order is based on the order of calculations. When XYZ rotations are given, some axis will get mixed in with others.
Example: in a bone chain with XYZ axis order, rotations on X axis would result 'closer' to what one would expect but the Z rotation will be slightly off due to it being calculated last.
Question (if I'm right on the above thought):
So if one never really intended to rotate on a certain axis, is it better to have that non-used axis at the end of the order ?
03-15-2006, 10:15 PM
Bingo - the default for most programs is xyz but you can change this in a lot of cases so whichever axis will move the most, get the rotation solver to do that first and you'll get less flipping. This is a really broad statement though and won't work in every situation though.
My site has some information on this. Read up on it and that will help as well. What is comes down to is a hierarchy of rotations. Change to gimble mode and you can see this. In the default axis, XYZ order the hierarchy is like this...
So just like any hierarchy if you rotate X it affects the object but not the other two axes. Rotate Y and it rotates X which rotates the object. Rotate Z and it rotates all of them. So if you rotate Y 90 then what happens is X is now laying on Z, this is known as gimble lock. The rule of thumb is the middle axis in any given axis order will be the one that causes gimble lock.
Quaternion rotations don't have this problem as there are no axes to gimble. A quat rotation is made of four values, the first three are a position on the surface of a sphere, you can then think of a pointer that starts at the center of the sphere and point to the position on the surface of the sphere. The forth value is the twist along the length of the pointer. Positions are the only absolute thing in 3D so this is why they are used. With an Euler rotation any given rotation can be described in an infinite amount of values. ie: [0,0,0]==[360,0,0] visualy and there is the gimble problem. With a quat value there is only one position on the surface of the sphere at [0,0,0] so you know where you are at. The problem with quat values is you can't wind them up. So one of the pit falls of Eulers is one of the strengths as well. You can only rotate a quat value half way around the surface of the sphere before it will decide to start going in the other direction. The problem with this is you can't have function curves that are meaningful as an object like a wheel rolling on the ground has a function curve that looks more like a wave form
So, math wise Quaternions are better to deal with but for animators euler are as the functions curves at least mean something useful.
Does this help at all?
03-16-2006, 06:05 PM
yes it does.
thank you Paul.
...I've got one last question.
03-17-2006, 07:21 PM
for a YZY or a ZXZ order, the Y and Z (respectfully) rotational values would not get calculated twice ?
I'll be quite honest with you...I have never checked what they actualy do as it just doesn't make sense. I should look into it though.
03-18-2006, 06:41 AM
that was a great explanation paul....just one question though..can u elaborate on this point???
The problem with quat values is you can't wind them up.
What this term exactly means??
OK, forget rotations, lets talk about positions. If you are at 0,0,0 and you move forward along the X axis to 10,0,0 lets say and you want to loop that you have to go back to 0,0,0 at some point unless you were to do it reletive to where you are.
Back to rotations, quaternion rotations can't work in a reletive fashion. What you have is a position on a sphere so once you have rotated a full 360 deg then you are right back to 0,0,0. So if you key a wheel rotating using quat values and you start at 0 and at frame 100 you rotate the wheel a full 360 deg, then scrub the animation the wheel doesn't rotate at all. This is because the point on the sphere is moving from 0,0,0 at from 0 to 0,0,0 at frame 100. If you did this with a postion in space well it wouldn't move either.
03-20-2006, 05:09 PM
guess it's like navigating longitude and latitude positions on earth...if you stood still at one point and sent your friend forward and they travelled the globe in a straight line, then your friend would approach you from behind.
Angleaxis can be wound up though past 360 degrees. This is the rotation around an axis.
Quats are vectors on a 4d hypsphere from a unit point. I dont know if Quats take the shortest route. There is some suggestion the linearlising the sphere flat from spherical coardinates to cylindrical, will take the longest route so over 360.
Quats use the equation i^2==j^2==k^2 == ijk ==-1, which uses imaginary numbers, its calculated all as one so cant be broken apart.
Interpolation across this 4d sphere is important, Lerp (linear interpolate) takes the start vector 0,0,0 to you your final vector linearly, where as Slerp follows the arc of the sphere.
With ZYZ is X treated as Z? the Z vector?
03-20-2006, 05:44 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2015, Jelsoft Enterprises Ltd.