PDA

View Full Version : Quaternion or Euler for Character Studio


Guibou
02-05-2008, 09:55 PM
Hi everyone, i saw that in Character Studio you have the choice to either set your rotations to Quaternion or Euler. I was wondering what is the impact in the end and if there's a way that is more proper for videogames.

Also you can change the order of the XYZ when set at Euler. I was wondering was is the purpose of that. If anyone has a full or partial answer, i'd be happy to here it. Thanks a lot guys :)

mrxzof
02-06-2008, 08:47 AM
Hello, Euler and Quaternion are mathematical methods of interpollation of animation. Euler uses Matrix, when Quaternions uses complex number. I'm not clever enough to explain better it, but you can see the difference, when you apply rotations on many axes, at the same time to an object (a cone for example). You will see that the sharped side of the cone won't move similarly. One moves in strait lines, when the other moves in arcs.

But actually, a real pro should explain better than me ! :p

jtico
02-06-2008, 11:59 AM
Quaternions are a mathematical tool you can use to describe rotations. With quaternions it's very easy to set an axis of rotation and an angle of rotation. Euler uses three axes and three angles to describe a rotation. With this axes and angles you can better understand the dynamics of a rotating body. You can use quaternions to set up the Euler description.

kees
02-06-2008, 07:44 PM
Game engines (and 3d applications) almost always use quaternions internally to do rotations because it is the superior way of handling rotations.

Animators often like Euler because it gives them a bit more control over the X Y and Z axis individually to tweak the animation curves.

In Max, rotations are eventually converted to quaternions, so even if you choose to use Euler, eventually they will be converted back in quaternions, and this sometimes causes problems.
(Objects spinning or turning inbetween keyframes for example)

Euler controllers also suffer from something called 'gimbal lock'. Which simply put means that 2 axis (for example X and Z) overlap with each other (You can visially see this problem in max by switching to the 'Gimbal' coordinate system when rotating objects with a euler controller).
This means you start to loose control over your object since you cannot rotate it in a certain direction anymore. This sounds complicated, and to explain it in text is difficult.

But it comes down to the fact that X, Y and Z are added together one by one.
So X is added to Y, and XY is added to Z.
This is where the 'euler order' comes into play:

By changing the order, you change the way X,Y and Z are added together.
This can reduce the 'gimbal lock' problem because you can set the order such that the axis you use less is in the middle (I believe it is the middle...may be different for biped)

I.e. if you don't use the X-axis much, but you use Y and Z alot to rotate, then the best order would be: YXZ

My memory is a little fuzzy on the order. It has been a while.
But I believe that the 1st axis you choose in the order is the most reliable.
The last one is the second most reliable.
And the middle one is the worst. So the middle one should always be the axis you use least.


If you want to understand in greater detail how euler and quaternions work, and the problems that occur when working with both and converting between both, I recommend you take some time and search on the internet. Welcome aboard the 'pain train'. :)

CGTalk Moderation
02-06-2008, 07: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.