Slide 1

Slide 1 text

Euler vs Hamilton Daniel Smith && Jan CW Kroeze University of Pretoria

Slide 2

Slide 2 text

INTRO

Slide 3

Slide 3 text

Various ways to rotate stuff

Slide 4

Slide 4 text

Various ways to rotate stuff Quaternions

Slide 5

Slide 5 text

Various ways to rotate stuff Quaternions Pitch-Yaw-Roll

Slide 6

Slide 6 text

Various ways to rotate stuff Quaternions Pitch-Yaw-Roll Matrices

Slide 7

Slide 7 text

Various ways to rotate stuff Quaternions Pitch-Yaw-Roll Matrices Angle-Axis

Slide 8

Slide 8 text

Various ways to rotate stuff Quaternions Pitch-Yaw-Roll Matrices Angle-Axis WHICH ONE??

Slide 9

Slide 9 text

Pitch-Yaw-Roll is just bad (Gimbal Lock)

Slide 10

Slide 10 text

Angle-Axis is complicated

Slide 11

Slide 11 text

Quaternions are popular

Slide 12

Slide 12 text

Rotation Matrices ... exist

Slide 13

Slide 13 text

How do we choose?

Slide 14

Slide 14 text

METRICS

Slide 15

Slide 15 text

SPEED

Slide 16

Slide 16 text

Rotating is a lot of FP math

Slide 17

Slide 17 text

sin, cos and FP multiplication

Slide 18

Slide 18 text

We measure total ns spent on calculations

Slide 19

Slide 19 text

STABILITY

Slide 20

Slide 20 text

What is stability?

Slide 21

Slide 21 text

Rounding errors! 4.0 + 3.0 = 6.99999999

Slide 22

Slide 22 text

Rotations get a bit wonky over time

Slide 23

Slide 23 text

Orthonormalisation

Slide 24

Slide 24 text

(Orthogonal + normal) + isation

Slide 25

Slide 25 text

Orthogonalisation + normalisation

Slide 26

Slide 26 text

Un-wonky rotations

Slide 27

Slide 27 text

How do you measure stability?

Slide 28

Slide 28 text

Compare limited-precision with perfect precision

Slide 29

Slide 29 text

(no such thing as perfect precision)

Slide 30

Slide 30 text

Compromise: double is “more perfect” than single

Slide 31

Slide 31 text

Discrepancy between single- and double-precision

Slide 32

Slide 32 text

EXPERIMENT

Slide 33

Slide 33 text

Implement a 3D camera

Slide 34

Slide 34 text

Rotate the camera using different methods

Slide 35

Slide 35 text

Measure stability and speed

Slide 36

Slide 36 text

RESULTS

Slide 37

Slide 37 text

Instability / Time after about a minute of input

Slide 38

Slide 38 text

Total CPU Time

Slide 39

Slide 39 text

Rotation Matrices accumulate instability at a much faster rate

Slide 40

Slide 40 text

(unless they’re orthonormalised)

Slide 41

Slide 41 text

Instability / Time

Slide 42

Slide 42 text

Quaternions are very well behaved

Slide 43

Slide 43 text

Orthonormalising quaternions is a silly idea

Slide 44

Slide 44 text

No content

Slide 45

Slide 45 text

Quaternions 3x faster than Rotation Matrices

Slide 46

Slide 46 text

3x faster!! (Order now, 50% off!)

Slide 47

Slide 47 text

(in the order of nanoseconds, so what difference does it make?)

Slide 48

Slide 48 text

Orthonormalising Quaternions make them faster?

Slide 49

Slide 49 text

???

Slide 50

Slide 50 text

CONCLUSION

Slide 51

Slide 51 text

What does it mean?

Slide 52

Slide 52 text

Keep using quaternions!

Slide 53

Slide 53 text

(but perhaps not for the reasons you expect)

Slide 54

Slide 54 text

SPEED

Slide 55

Slide 55 text

STABILITY

Slide 56

Slide 56 text

INTERPOLATION

Slide 57

Slide 57 text

SUNROOF!

Slide 58

Slide 58 text

No content