3D Game Engine Design 1 3D Game Engine Design Ch D MAP LAB
3D Game Engine Design 2 Quaternion Quaternion Algebra Def > A Quaternion is defined by q = w + xi + yj + zk where w, x, y, z are in R and Def> Let then
3D Game Engine Design 3 Quaternion(cont’d)
3D Game Engine Design 4 Quaternion(cont’d) Thm> Let then and let then quaternion multiplication can be defined using vector dot product and cross product Thm> A quaternion q may be also viewed as a 4D vector( w, x, y, z).then the dot product of two quaternion is
3D Game Engine Design 5 Quaternion(cont’d) Def> A unit quaternion is a quaternion q for which Thm> The inverse of unit quaternion and the product of unit quaternion are themselves unit quaternion. Unit quaternion can be represented by
3D Game Engine Design 6 Quaternion(cont’d) has length 1. However observe that the quaternion product similar to unit-length complex numbers Euler’s identity for complex numbers generalizes to quaternion. Thm> The power of unit quaternion The logarithm of unit quaternion
3D Game Engine Design 7 Quaternion(cont’d) Caution : standard identities are not allowed because of non-commutative of quaternion. That is,
3D Game Engine Design 8 Quaternion(cont’d) Relationship to quaternion to rotation Thm> Unit quaternion represents the rotation of the 3D vector by an angle about the 3D axis. And rotated vector is represented by. Proof> it is enough to show that R(v) is 3D vector R(v) is length preserving function. R(v) is linear transformation. R(v) doesn’t have reflection component. Rotation axis is really u. ( 1) Rotation angle (2) We will prove (1),(2)
3D Game Engine Design 9 Quaternion(cont’d) (1) (2) u v w
3D Game Engine Design 10 Quaternion(cont’d)
3D Game Engine Design 11 Quaternion(cont’d) Conversion between various rotation representations Angle-axis rotation Quaternion rotationRotation matrix
3D Game Engine Design 12 Quaternion(cont’d) Conversion between angle-axis and rotation matrix Thm> angle-axis to rotation matrix
3D Game Engine Design 13 Quaternion(cont’d) Thm> Rotation matrix to angle-axis =0 or 180(??)
3D Game Engine Design 14 Quaternion(cont’d) Conversion between quaternion and angle-axis Thm> angle-axis to quaternion Thm> quaternion to angle-axis
3D Game Engine Design 15 Quaternion(cont’d) Conversion between quaternion and rotation matrix Thm> quaternion to rotation matrix Thm> rotation matrix to quaternion