
Quaternion Rotation and Complex Numbers in Games
Explore the concepts of quaternion rotation and complex numbers for game graphics, including representations, rotation matrices, Euler angles, quaternions, and complex arithmetic. Learn how these concepts are applied in game development for transformations and geometry manipulation.
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
Quaternion Rotation UMBC Graphics for Games
Rotation Matrices Rotation can be expressed as an orthogonal matrix Every orthogonal matrix is a rotation and/or mirroring New X axis New Y axis New Z axis
Rotation Matrices Rotation can be expressed as an orthogonal matrix Every orthogonal matrix is a rotation and/or mirroring Fits with other transformation matrices Translation, Scaling, Reflection, Perspective Interpolations between rotation matrices are not rotations Interpolates endpoint positions
Euler Angles Rotate around series of axes Roll, Pitch, Yaw Intuitive, pitch/yaw form common for first person controllers Yaw = turn left/right Pitch = look up/down Roll = rotate around view Subject to gimbal lock First axis lines up with last axis, lose ability to rotate freely Interpolates along lines of longitude/latitude Can be weird near poles
Quaternions Extension of complex numbers Interpolations on great circle Related Geometric Algebra also works Though not as popular in games
Imaginary number i Define imaginary number i where Complex number has real and imaginary components Interpret as points on the 2D plane Conjugate: negate the imaginary part
Complex Arithmetic Addition: add components Multiplication Component algebra: Multiply magnitudes, add angles:
Complex Transformations Point Translation = addition Scale = multiply by real scalar Rotate = multiply by unit-length complex (magnitude = 1) Component form is identical to matrix rotation
Basic Rotations Pure imaginary = rotation by 90
Quaternion basics First created by Hamilton in 1843 for physics rotations Define orthogonal imaginary axes Multiplication order matters, positive in ijk order
Quaternion Math Like complex has real + imaginary, quaternion is real + vector Conjugate negates vector part Addition by component
Quaternion Multiplication By component Vector form
Quaternion Transformations Point is pure quaternion Translation = addition of pure quaternion Scale = multiply by real scalar Rotation = sandwiched multiply by unit quaternion and conjugate Where For one point, algebraically optimized version with cross products For more points, cheaper to convert to matrix
Basic Rotations Rotation Rotate by 0 Rotate by 180 around vector
Interpolation Interpolate along great circle between two vectors / quaternions Normalized Linear Interpolation (NLERP) Cheap, but speeds up in the middle Spherical Linear Interpolation (SLERP) Interpolate in equal-angular steps