 
Quaternion rotations are the way most 3D packages calculate rotations in 3D space. We saw in the Euler XYZ that it doesn't represent what a rotation really looks like in 3D space. Because of this quaternion rotations are used. A quaternion is calculated using four values instead of only three, X, Y, Z and angle. When printed out using Max script it will look like this, (quat 0 0 0 1) or (quat X Y Z angle), this represents an object that is aligned to world space. The best way to describe how it works is a sphere with an arrow pointing from the center out to the surface. The XYZ value is not a rotation but a vector or position, this will represent the position of the point of the arrow on the surface of the sphere and the angle is the rotation around the arrow.
Quaternions are the preferred method for representing rotations in 3D space because of the inherit problems of the Euler method. Quaternions use four values to describe a rotation. X, Y, Z and angle where X, Y, Z are divided from complex numbers and angle is a scalar value. The best visual reference of how this works would be a sphere with an arrow pointing (unit arrow) from the center to the surface. X, Y, Z describes the rotation about the (unit arrow) and angle is the rotation along its length.
Describing a rotation using quaternion allows for only two possible solutions, a positive and a negative. This differs from an Euler in that an Euler can have an infinite numbers of possible solutions for the same rotation.
To better describe how this works you need to know that a quaternion cannot be wound up like an Euler angle can. If we were to rotate a quaternion a full 360 degrees, what you will actually get is a rotation from 0 to 180 degrees and then from -180 to 0 degrees. So if we were to rotate an object from 0 to 270 degrees the result will be the object rotating backwards from 0 to -90 degrees since there is no + 270 degrees. A quaternion will always try to take the shortest way to get to any given rotation. This is a limitation that is easy to get around by just setting more keys on smaller rotations. |