Quaternion Rotation and Complex Numbers in Games

quaternion rotation n.w
1 / 18
Embed
Share

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.

  • Games
  • Graphics
  • Quaternion
  • Rotation
  • Complex Numbers

Uploaded on | 0 Views


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


  1. Quaternion Rotation UMBC Graphics for Games

  2. Representing Rotation

  3. 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

  4. 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

  5. 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

  6. Quaternions Extension of complex numbers Interpolations on great circle Related Geometric Algebra also works Though not as popular in games

  7. Complex Numbers

  8. 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

  9. Complex Arithmetic Addition: add components Multiplication Component algebra: Multiply magnitudes, add angles:

  10. 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

  11. Basic Rotations Pure imaginary = rotation by 90

  12. Quaternions

  13. Quaternion basics First created by Hamilton in 1843 for physics rotations Define orthogonal imaginary axes Multiplication order matters, positive in ijk order

  14. Quaternion Math Like complex has real + imaginary, quaternion is real + vector Conjugate negates vector part Addition by component

  15. Quaternion Multiplication By component Vector form

  16. 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

  17. Basic Rotations Rotation Rotate by 0 Rotate by 180 around vector

  18. 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

More Related Content