1 kipa game engine seminars jonathan blow ajou university december 13, 2002 day 16
TRANSCRIPT
![Page 1: 1 KIPA Game Engine Seminars Jonathan Blow Ajou University December 13, 2002 Day 16](https://reader035.vdocument.in/reader035/viewer/2022072014/56649e875503460f94b8a34d/html5/thumbnails/1.jpg)
1
KIPA Game Engine Seminars
Jonathan Blow
Ajou University
December 13, 2002
Day 16
![Page 2: 1 KIPA Game Engine Seminars Jonathan Blow Ajou University December 13, 2002 Day 16](https://reader035.vdocument.in/reader035/viewer/2022072014/56649e875503460f94b8a34d/html5/thumbnails/2.jpg)
2
Rotation in 2D
• Multiplication of complex numbers
• Complex number representation in polar coordinates (magnitude, angle)
![Page 3: 1 KIPA Game Engine Seminars Jonathan Blow Ajou University December 13, 2002 Day 16](https://reader035.vdocument.in/reader035/viewer/2022072014/56649e875503460f94b8a34d/html5/thumbnails/3.jpg)
3
Euler’s Formula
• eiθ = cosθ + i sinθ
• Looking at the derivative of each side
![Page 4: 1 KIPA Game Engine Seminars Jonathan Blow Ajou University December 13, 2002 Day 16](https://reader035.vdocument.in/reader035/viewer/2022072014/56649e875503460f94b8a34d/html5/thumbnails/4.jpg)
4
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)
![Page 5: 1 KIPA Game Engine Seminars Jonathan Blow Ajou University December 13, 2002 Day 16](https://reader035.vdocument.in/reader035/viewer/2022072014/56649e875503460f94b8a34d/html5/thumbnails/5.jpg)
5
Quaternion
• As an axis/angle representation
• Re-derivation of qvq*
![Page 6: 1 KIPA Game Engine Seminars Jonathan Blow Ajou University December 13, 2002 Day 16](https://reader035.vdocument.in/reader035/viewer/2022072014/56649e875503460f94b8a34d/html5/thumbnails/6.jpg)
6
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
![Page 7: 1 KIPA Game Engine Seminars Jonathan Blow Ajou University December 13, 2002 Day 16](https://reader035.vdocument.in/reader035/viewer/2022072014/56649e875503460f94b8a34d/html5/thumbnails/7.jpg)
7
Multiplying by a Non-Unit Quaternion
• Scales the vector
• (demonstration of this)
• (analogy to 2D case)
![Page 8: 1 KIPA Game Engine Seminars Jonathan Blow Ajou University December 13, 2002 Day 16](https://reader035.vdocument.in/reader035/viewer/2022072014/56649e875503460f94b8a34d/html5/thumbnails/8.jpg)
8
Quaternion Powers
• What is q2?
• What is qt?
![Page 9: 1 KIPA Game Engine Seminars Jonathan Blow Ajou University December 13, 2002 Day 16](https://reader035.vdocument.in/reader035/viewer/2022072014/56649e875503460f94b8a34d/html5/thumbnails/9.jpg)
9
SLERP
• As q0(1-t)q1
t
• Rewrite this as q0(q0-1q1)t
![Page 10: 1 KIPA Game Engine Seminars Jonathan Blow Ajou University December 13, 2002 Day 16](https://reader035.vdocument.in/reader035/viewer/2022072014/56649e875503460f94b8a34d/html5/thumbnails/10.jpg)
10
Exponential Formof a Quaternion
• cosθ + y sinθ ; y is axis of rotation
• eyθ
![Page 11: 1 KIPA Game Engine Seminars Jonathan Blow Ajou University December 13, 2002 Day 16](https://reader035.vdocument.in/reader035/viewer/2022072014/56649e875503460f94b8a34d/html5/thumbnails/11.jpg)
11
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
![Page 12: 1 KIPA Game Engine Seminars Jonathan Blow Ajou University December 13, 2002 Day 16](https://reader035.vdocument.in/reader035/viewer/2022072014/56649e875503460f94b8a34d/html5/thumbnails/12.jpg)
12
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?
![Page 13: 1 KIPA Game Engine Seminars Jonathan Blow Ajou University December 13, 2002 Day 16](https://reader035.vdocument.in/reader035/viewer/2022072014/56649e875503460f94b8a34d/html5/thumbnails/13.jpg)
13
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
![Page 14: 1 KIPA Game Engine Seminars Jonathan Blow Ajou University December 13, 2002 Day 16](https://reader035.vdocument.in/reader035/viewer/2022072014/56649e875503460f94b8a34d/html5/thumbnails/14.jpg)
14
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
![Page 15: 1 KIPA Game Engine Seminars Jonathan Blow Ajou University December 13, 2002 Day 16](https://reader035.vdocument.in/reader035/viewer/2022072014/56649e875503460f94b8a34d/html5/thumbnails/15.jpg)
15
Simple Cases For Quaternions
• qxq*
• qxq* dot x
• Convert quaternion to rotation matrix
![Page 16: 1 KIPA Game Engine Seminars Jonathan Blow Ajou University December 13, 2002 Day 16](https://reader035.vdocument.in/reader035/viewer/2022072014/56649e875503460f94b8a34d/html5/thumbnails/16.jpg)
16
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