Game Development Reference
In-Depth Information
•
Rotating points between coordinate spaces (object and upright)
◦
Matrix
: Possible; can often by highly optimized by SIMD instructions.
◦
Euler Angles
: Impossible (must convert to rotation matrix).
◦
Exponential Map
: Impossible (must convert to rotation matrix).
◦
Quaternion
: On a chalkboard, yes. Practically, in a computer, not really. You might as well
convert to rotation matrix.
•
Concatenation of multiple rotations
◦
Matrix
: Possible; can often be highly optimized by SIMD instructions. Watch out for matrix
creep.
◦
Euler Angles
: Impossible.
◦
Exponential Map
: Impossible.
◦
Quaternion
: Possible. Fewer scalar operations than matrix multiplication, but maybe not as
easy to take advantage of SIMD instructions. Watch out for error creep.
•
Inversion of rotations
◦
Matrix
: Easy and fast, using matrix transpose.
◦
Euler Angles
: Not easy.
◦
Exponential Map
: Easy and fast, using vector negation.
◦
Quaternion
: Easy and fast, using quaternion conjugate.
•
Interpolation
◦
Matrix
: Extremely problematic.
◦
Euler Angles
: Possible, but Gimbal lock causes quirkiness.
◦
Exponential Map
: Possible, with some singularities, but not as troublesome as Euler angles.
◦
Quaternion
: Slerp provides smooth interpolation.
•
Direct human interpretation
◦
Matrix
: Difficult.
◦
Euler Angles
: Easiest.
◦
Exponential Map
: Very difficult.
◦
Quaternion
: Very difficult.
•
Storage efficiency in memory or in a file
◦
Matrix
: Nine numbers.
◦
Euler Angles
: Three numbers that can be easily quantized.
◦
Exponential Map
: Three numbers that can be easily quantized.
◦
Quaternion
: Four numbers that do not quantize well; can be reduced to three by assuming
fourth component is always nonnegative and quaternion has unit length.
•
Unique representation for a given rotation
◦
Matrix
: Yes.
◦
Euler Angles
: No, due to aliasing.
◦
Exponential Map
: No, due to aliasing, but not as complicated as Euler angles.
◦
Quaternion
: Exactly two distinct representations for any angular displacement, and they are
negatives of each other.
•
Possible to become invalid
◦
Matrix
: Six degrees of redundancy inherent in orthogonal matrix. Matrix creep can occur.
◦
Euler Angles
: Any three numbers can be interpreted unambiguously.
◦
Exponential Map
: Any three numbers can be interpreted unambiguously.
◦
Quaternion
: Error creep can occur.
Table 8.1.
Comparison of matrices, Euler angles, exponential maps, and quaternions
Search WWH ::
Custom Search