160 likes | 237 Views
KIPA Game Engine Seminars. Day 16. Jonathan Blow Ajou University December 13, 2002. Rotation in 2D. Multiplication of complex numbers Complex number representation in polar coordinates (magnitude, angle). Euler’s Formula. e i θ = cosθ + i sinθ Looking at the derivative of each side.
E N D
KIPA Game Engine Seminars Day 16 Jonathan Blow Ajou University December 13, 2002
Rotation in 2D • Multiplication of complex numbers • Complex number representation in polar coordinates (magnitude, angle)
Euler’s Formula • eiθ = cosθ + i sinθ • Looking at the derivative of each side
All rotations in 3D can be expressed as rotation by an angle around an axis • Definition of the axis as an eigenvector of the rotation • Proof that in 3D all transforms have 1 or 3 (real) eigenvalues • So we have 1 or 3 axes of rotation • 3 axes means it’s the identity rotation (maybe with scaling)
Quaternion • As an axis/angle representation • Re-derivation of qvq*
Mathematical demonstrationthat the expression qvq* rotates the vector v • Work out the terms, breaking v into components parallel and orthogonal to the axis • Show what qvq* does to each of these components
Multiplying by a Non-Unit Quaternion • Scales the vector • (demonstration of this) • (analogy to 2D case)
Quaternion Powers • What is q2? • What is qt?
SLERP • As q0(1-t)q1t • Rewrite this as q0(q0-1q1)t
Exponential Formof a Quaternion • cosθ + y sinθ ; y is axis of rotation • eyθ
The Log of a Quaternion • log eyθ = yθ • But be careful, the additive log identity doesn’t work here! • It requires commutative multiplication • Demonstration of this on whiteboard • The identity does work if the axes are colinear
The Exponential Map • Is the log of a quaternion • Actually it can also mean the log of an arbitrary transformation matrix, but here we are restricted to quaternions • We can interpolate in this space • What are the properties of this interpolation?
The Exponential Map • It interpolates at constant speed, but it is not the same function as slerp • Therefore it cannot possibly follow the shortest path of interpolation • (otherwise they’d be the same function!) • Indeed the further away the source orientations, the wider the path used by the exponential map
The Exponential Map • But sometimes you care most about constant speed, so the exponential map works well for that • Provides a method of linearization that’s different from the linear interpolation in quaternion space discussed last week • Also apparently there’s lots of other math you can do with these, which I don’t know, read some advanced robotics papers to find out
Simple Cases For Quaternions • qxq* • qxq* dot x • Convert quaternion to rotation matrix
Discussion of my quaternion IK work • (demo of app) • People generally use Euler angles for IK but they are slow and unintuitive • We can use quaternions instead to build a fast system