Aalto CS-C3100 Computer Graphics, Fall 2016

Size: px
Start display at page:

Download "Aalto CS-C3100 Computer Graphics, Fall 2016"

Transcription

1 Aalto CS-C3100 Computer Graphics, Fall 2016 Representation and Interpolation of Wikipedia user Blutfink Rotations...or, adventures on the 4D unit sphere Jaakko Lehtinen with lots of slides from Frédo Durand 1

2 Today s Plan What is a rotation? Some simple rotation representations 3x3 orthogonal matrix axis-angle ( exponential map ) Euler angles Limitations Quaternions Warmup: 2D rotations and complex numbers Spherical linear interpolation (slerp) Representing rotations using quaternions 2

3 Today s Plan What is a rotation? Some simple rotation representations 3x3 orthogonal matrix axis-angle ( exponential map ) Euler angles Limitations Quaternions Warmup: 2D rotations and complex numbers Spherical linear interpolation (slerp) Representing rotations using quaternions Rotation Survival Guide: What to do in practice 3

4 Orientations are Everywhere Euclidean transforms Preserves distances Preserves angles Rigid / Euclidean Identity Translation Rotation 4

5 Orientations are Everywhere In an articulated character, each joint is characterized by its degrees of freedom (dof) Usually rotation about one, two or three axes 1 DOF: knee 2 DOF: wrist 3 DOF: arm 5

6 What is an Orientation? 6

7 What is an Orientation? Most intuitive view: orthogonal coordinate system ȳ x z 7

8 What is an Orientation? Most intuitive view: orthogonal coordinate system ȳ Orthogonality: x k xk = kȳk = k zk =1 x ȳ =0 z x z =0 ȳ z =0 8

9 What is an Orientation? Most intuitive view: orthogonal coordinate system ȳ x Put axes as columns in 3x3 matrix: M = x ȳ z C A... z then orthogonality,.? 9

10 What is an Orientation? Most intuitive view: orthogonal coordinate system ȳ x Put axes as columns in 3x3 matrix: M = x ȳ z C A... z then orthogonality, M T M = I 10

11 What is an Orientation? Most intuitive view: orthogonal coordinate system ȳ x M = Why? x ȳ z C A... z M T M = 0 x x x ȳ 1 x ȳ x ȳ ȳ ȳ z A z x z ȳ z z 11

12 But also: Orientation is Rotation 12

13 Rotation is Orientation Euler s Rotation Theorem: All pairs of 3D orthogonal (Cartesian) coordinate systems that share a common origin are related through a rotation about some fixed axis. In other words, you can orient any orthogonal coordinate frame with any other using such a rotation. 13

14 Rotation is Orientation Euler s Rotation Theorem: All 3D orthogonal (Cartesian) coordinate systems that share a common origin are related through a rotation about some fixed axis. In other words, you can orient any orthogonal coordinate frame with any other using such a rotation. Consequence: Orientation is really the same as rotation This is because you can get to any orientation from the identity transform using a rotation. 14

15 Euler s Rotation Theorem Orientation 1 15

16 Euler s Rotation Theorem Orientation 1 Orientation 2 16

17 Euler s Rotation Theorem Orientation 1 Orientation 2 They are related by a rotation about this axis 17

18 Euler s Rotation Theorem Orientation 1 Orientation 2 They are related by a rotation about this axis 18

19 Euler s Rotation Theorem Orientation 1 Orientation 2 They are related by a rotation about this axis 19

20 Rotation is Orientation Euler s Rotation Theorem: All 3D orthogonal (Cartesian) coordinate systems that share a common origin are related through a rotation about some fixed axis. In other words, you can orient any orthogonal coordinate frame with any other using such a rotation. Consequence: Orientation is really the same as rotation This is because you can get to any orientation from the identity transform using a rotation. This is not really surprising, because rotations form a group, remember? Rotation A followed by rotation B is a new rotation C 20

21 Plane Rotations How many degrees of freedom? (origin really stays fixed) 21

22 2D (Plane) Rotations How many degrees of freedom? θ 1 DOF, just one rotation angle 22

23 3D Rotations How many degrees of freedom? 23

24 3D Rotations How many degrees of freedom? 3 degrees of freedom (? 2D only had 1 ) direction of rotation (2D) and angle (1D) Only have to care for angle 0 < θ < π Why? When over π, negate axis, take angle 2π - θ θ 24

25 3D Rotations How many degrees of freedom? 3 degrees of freedom direction of rotation (2D) and angle (1D) Only have to care for angle 0 < θ < π Why? When over π, negate axis, take angle 2π - θ Because orientations and rotations are basically the same, this means orientations are also 3D. θ 25

26 What is a Rotation? Axis-angle view (as above): Rotation about an axis v by angle θ Can also encode rotation in one 3D vector ( rotation vector ) r = θv, where θ is the angle and v is a unit vector (the axis) Origin is identity, length of vector encodes angle Points inside the sphere of radius π then correspond to orientations (Namedropping: The exponential map ) 26

27 What is a Rotation? Axis-angle view (as above): Rotation about an axis v by angle θ Can also encode rotation in one 3D vector ( rotation vector ) r = θv, where θ is the angle and v is a unit vector (the axis) Origin is identity, length of vector encodes angle Points inside the sphere of radius π then correspond to orientations (Namedropping: The exponential map ) Linear algebra view Orthogonal matrix, M T M = I, det(m) = 1 (to rule out reflections) In other words, M has orthonormal columns (and rows), i.e., the columns are basis vectors at right angles Count the DOFs... 27

28 What is a Rotation? Axis-angle view (as above): Rotation about an axis v by angle θ Can also encode rotation in one 3D vector ( rotation vector ) r = θv, where θ is the angle and v is a unit vector (the axis) Origin is identity, length of vector encodes angle Points inside the sphere of radius π then correspond to orientations (Namedropping: The exponential map ) Linear algebra view Orthogonal matrix, M T M = I, det(m) = 1 (to rule out reflections) In other words, M has orthonormal columns (and rows), i.e., the columns are basis vectors at right angles Overcomplete representation: M has more than 3 entries, meaning that not all matrices are proper rotations (duh) 28

29 Interpolating Orientations in 3D Critical for animation Given rotation matrices M i and time t i, find M(t) such that M(t i )=M i Problem reduces to question: How do you morph between two rotations? t=t3 v t=t1 u n t=t2 M(t) = ux(t) vx(t) nx(t) uy(t) vy(t) ny(t) uz(t) vz(t) nz(t) 29

30 Interpolating Orientations in 3D Critical for animation Given rotation matrices M i and time t i, find M(t) such that M(t i )=M i Problem reduces to question: How do you morph between two rotations? t=t3 Interpolating positions is easy, just use splines v t=t1 u n t=t2 M(t) = ux(t) vx(t) nx(t) uy(t) vy(t) ny(t) uz(t) vz(t) nz(t) 30

31 First Try Interpolate each matrix entry independently Example: M0 is identity and M1 is 90 degrees around x-axis Is the result a rotation matrix? 31

32 Rotation Interpolation: Flawed Solution Interpolate each matrix entry independently Example: M0 is identity and M1 is 90 degrees around x-axis Is the result a rotation matrix? No, it does not preserve rigidity (angles and lengths) What does it do? 32

33 Are Rotations Simply Vectors, Then? Axis-angle: Rotation about an axis (3 DOF) Can encode rotation in one 3D vector r = θv, where θ is the angle and v is a unit vector Origin is identity All good? Let s think about θv, (θ+n2π)v, (2π-θ)(-v)? n2πv, in particular r = 2πv? θ 33

34 Are Rotations Simply Vectors, Then? Axis-angle: Rotation about an axis (3 DOF) Can encode rotation in one 3D vector r = θv, where θ is the angle and v is a unit vector Origin is identity All good? Let s think about θv, (θ+n2π)v, (2π-θ)(-v)? n2πv, in particular r = 2πv? There are infinitely many 3D axis-angle vectors that correspond to the same rotation. E.g., the whole ball r = 2π is the identity. Things are relatively OK if we stay within the sphere of radius π. θ 34

35 Another Try: Rotation Angles An Euler angle is a rotation about a single coordinate axis performed (e.g.) in the sequence Z-Y-Z Corresponds to a gimbal Such a sequence of 3 can get you to any orientation Can also use a sequence of rotations around X-Y-Z Roll, pitch and yaw (perfect for flight simulation) b a a b a c c c b = c b a b a c 35

36 Another Try: Rotation Angles An Euler angle is a rotation about a single coordinate axis performed (e.g.) in the sequence Z-Y-Z Corresponds to a gimbal Such a sequence of 3 can get you to any orientation Can also use a sequence of rotations around X-Y-Z Roll, pitch and yaw (perfect for flight simulation) Problems: Bad interpolation Gimbal lock b a a b a b = a c a c c b c b c 36

37 Gimbal Lock Two or more axis align resulting in a loss of rotation degrees of freedom

38 Video See here: zc8b2jo7mno&start=32&end=190&version=3 38

39 Fundamental Problem The space of rotations ( the rotation group ) is not Euclidean If you increase the rotation angle, you end up where you started (Buzzword: The topology of the rotation group is that of the projective space RP 3 ) 39

40 Fundamental Problem The space of rotations ( the rotation group ) is not Euclidean If you increase the rotation angle, you end up where you started (Buzzword: The topology of the rotation group is that of the projective space RP 3 ) Even though the space is 3D, rotations cannot be represented in R 3 without kinks or multiple-valuedness Euler angles are really really nasty (gimbal lock, bad interpolation, cannot be composed easily) Axis-angle is multiple-valued, doesn t interpolate nicely without special considerations, cannot be easily composed 3x3 matrices are redundant and don t interpolate nicely, but can be composed easily (matrix multiplication) 40

41 Demo Click here to see a screen capture movie 41

42 Questions? 42

43 Let s Turn to Interpolation Problem reduces to question: How do you morph between two rotations? t=t3 v t=t1 u n t=t2 M(t) = ux(t) vx(t) nx(t) uy(t) vy(t) ny(t) uz(t) vz(t) nz(t) 43

44 Desirable Properties for Interpolation Remember Euler s theorem: All orientations A, B are related by a rotation R around an axis v by an angle θ: B = AR. R can be represented as r = θv Interpolated orientation should rotate around v with constant speed, starting from zero angle. 44

45 Recipe for Axis-Angle Interpolation Remember Euler s theorem: All orientations A, B are related by a rotation R around an axis v by an angle θ: B = AR. R can be represented as r = θv Interpolated orientation should rotate around v with constant speed, starting from zero angle. Axis-angle interpolation how-to: Compute R as A -1 B Extract axis-angle representation r from R (how to in a while) Interpolate linearly between zero and r to yield r(t), i.e., r(t) = tr Convert r(t) back to matrix R(t) Get final orientation by computing AR(t) 45

46 Interpolation Using Axis-Angle This works because the interpolated rotation vector starts at zero (identity) and always points to the same direction r r(t) = tr, remember equivalently, the axis stays fixed and the angle changes linearly I.e., in the local coordinate system of A, the rotation axis direction stays fixed, only angle changes. 46

47 Interpolation Using Axis-Angle This works because the interpolated rotation vector starts at zero (identity) and always points to the same direction r r(t) = tr, remember equivalently, the axis stays fixed and the angle changes linearly I.e., in the local coordinate system of A, the rotation axis direction stays fixed, only angle changes. Remember that A and B are both rotations, too. However if you represent them as vectors ra and rb using axisangle, and interpolate the corresponding 3D vectors linearly, this does NOT yield the correct result. It interpolates the orientations, but not around v at unit speed. (Why not? It s kind of deep. Let s not go there.) In contrast, what we did on previous slide: Axis-angle interpolation of the relative rotation R between A and B. 47

48 Axis-angle to Matrix Given unit axis v, angle θ, compute rotation matrix R This is a restatement of Rodrigues formula v + = 0 v 3 v 2 v 3 0 v 1 v 2 v 1 0 This matrix corresponds to cross product with v. R = I cos + (1 cos )vv T v + sin If represented as r=θv, must normalize and compute length first, and watch out for zeros Outer product 48

49 Matrix to Axis-Angle Given rotation matrix R, compute axis v and angle θ = cos 1 ((R 11 + R 22 + R 33 1)/2) v 1 =(R 32 R 23 )/(2 sin ) v 2 =(R 13 R 31 )/(2 sin ) v 3 =(R 21 R 12 )/(2 sin ) Derived using the fact that the rotation axis is the only real eigenvector of a rotation matrix Don t worry about it 49

50 Recap You can t identify orientations/rotations with 3D points and have all of Nice interpolation Smoothness (no gimbal lock) Simple composition of rotations No complicated multiple-valuedness (You can, however, interpolate relative changes in orientation using the axis-angle representation.) Next: Quaternions, a 4D construction that does exactly what we want, both absolutely and relatively We ll represent rotations using unit quaternions, i.e., points lying on the 4-dimensional unit hypersphere (simple, eh?) 50

51 Questions? 51

52 1D Sphere and Complex Plane Represent 2D rotation by point on unit circle 2 coordinates but only 1 DOF And we can say that the 2D plane is the complex plane Orientation = complex argument Unit circle = complex magnitude is 1 Interestingly, composition of rotation " complex multiplication Trivial with exponential notation re iθ θ 0 θ 1 q0 q1 Remember homogeneous coordinates? Adding a dimension can make life easier. Interpolation of angle is easy: Just slide the point along the circle. 52

53 Velocity Issue: lerp vs. slerp Linear Interpolation (lerp) between the 2D points interpolates the straight line between the two orientations Renormalize q(t) to lie on the circle again lerp motion does not have uniform angular velocity keyframes Aalto lerp CS-C3100 Fall Lehtinen 53

54 Velocity Issue: lerp vs. slerp Linear Interpolation (lerp) between the 2D points interpolates the straight line between the two orientations lerp motion does not have uniform angular velocity Spherical Linear Interpolation (slerp) interpolates along the arc lines by adding a sine term: where ω is the angle between q 0 and q 1 We still interpolate in 2D plane, but along an arc Silly to make things so complex in 2D, but will be critical in 3D keyframes lerp slerp interpolate along arc line rather than secant 54

55 Slerp derivation (2D) Frame c 0, v v =[c 1 -(c 1.c 0 )c 0 ]/sin ω =[c 1 -cos ω c 0 ]/sin ω P(t) in frame c 0, v: (cos ωt, sin ωt) That is P(t)=c 0 cos ωt+v sin ωt =c 0 cos ωt +sin ωt [c 1 -cos ω c 0 ]/sin ω =c 0 [cos ωt -sin ωt cos ω/sin ω]+ c 1 sin ωt /sin ω =c 0 [cos ωt sin ω -sin ωt cos ω]/sin ω+ c 1 sin ωt /sin ω =c 0 sin (ω ωt) /sin ω+ c 1 sin ωt /sin ω ω θ 0 c 0 c 1 θ 1 v P(t) [remember your trigonometry] 55

56 Velocity Issue: lerp vs. slerp Linear Interpolation (lerp) between the 2D points interpolates the straight line between the two orientations Brain teasers lerp motion Can does not you have uniform prove angular that... velocity Spherical Linear Interpolation (slerp) interpolates along the arc lines by adding a sine term: 1) slerp produces a constant-speed curve? 2) the result is always a unit vector when where ω is the angle between q 0 and q 1 We still interpolate in 2D plane at unit speed, but along an arc Silly to make things so complex in 2D, but will be critical in 3D q0 and q1 are unit vectors? (Hint for 1: Differentiate w.r.t. t, take magnitude, trig identities General hints: trig identities, interpolate q0 and q1 are unit, definition of ω) along arc line rather than secant keyframes Aalto lerp CS-C3100 Fall Lehtinen slerp 56

57 Questions? Recap plane rotation in 2D: a point on unit circle complex number interpretation use slerp for uniform speed works on the sphere in any dimension θ 1 θ 0 57

58 2-DOF Orientation Can represent by 2 angles But this is messy because modulo 2π and pole... q0 q1 58

59 2-DOF Orientation Can represent by 2 angles But this is messy because modulo 2π and pole... Solution: Embed 2-sphere in 3D Interpolate 3D points on the 2-sphere along great circles When done interpolating, convert the point back to angles Use slerp for uniform velocity & to stay on sphere Note that it s still a 1D problem along the great circle q 0 and q1 are now 3D points q0 q1 59

60 3 DOF Quaternions Use the same principle interpolate on higher-dimensional sphere use slerp formula to get uniform angular velocity, stay on 3-sphere 3-sphere embedded in 4D More complex, harder to visualize A point on 3-sphere corresponds to an 3D orientation 60

61 Quaternions: Hypercomplex Numbers Due to Hamilton (1843) Can be defined like complex numbers but with 4 coordinates d+ai+bj+ck One real part (d), three imaginary ones. Based on three different roots of -1: i 2 = j 2 = k 2 = -1 and weird multiplication rules ij = k = -ji jk = i = -kj ki = j = -ik 61

62 Quaternions: Hypercomplex Numbers Due to Hamilton (1843) Can be defined like complex numbers but with 4 coordinates d+ai+bj+ck One real part (d), three imaginary ones. Or defined with an imaginary part v that is a 3D vector: (s, v) simpler notation 62

63 Quaternions: Rotation Representation Rotations represented by unit vectors in 4D Right-hand rotation of θ radians about v: q = (cos(θ/2); v sin(θ/2)), v Notes unit quaternions are restricted to the unit 3-sphere in 4D (by definition of the unit sphere) q & -q represent the same orientation Why? (Hint: Graphs of sine and cosine, what happens to angle when axis flips if rotation is to remain same?) Resembles axis-angle, but with the sines and cosines 63

64 Quaternions: Identity Rotations represented by unit vectors in 4D Right-hand rotation of θ radians about v: q = (cos(θ/2); v sin(θ/2)), v Identity orientation? 64

65 Quaternions: Identity Rotations represented by unit vectors in 4D Right-hand rotation of θ radians about v: q = (cos(θ/2); v sin(θ/2)), v Identity orientation? θ is zero => scalar part = 1 Axis can be arbitrary, but since we want a unit quaternion => q = (1, 0) BUT: Can also take q = (-1, 0) q & -q represent the same rotation, remember 65

66 Question? Recap: Rotation in 2D embedded on unit circle complex number interpretation slerp for uniform speed works on the sphere in any dimension Quaternions 4D extension of complex numbers rotations = unit quaternions (on 3-sphere) (cos(θ/2); v sin(θ/2)) : rotation of θ around v q q v 66

67 Interpolating Rotations Given two unit quaternions, we want to interpolate Use slerp Works on the sphere in any dimension Where ω is still the angle between q0 and q1 like in 2D Note: This is again a linear combination of q 0 and q1 Quaternion slerp gives exactly the desired unitspeed transition between the orientations represented by q0 and q1 And does so without any of the problems we saw with axis-angle, Euler, or matrices 67

68 Linear Combination of Quaternions Just like vectors, just like complex numbers Addition: Componentwise (s, v) + (s, v ) = (s+s, v+v ) Multiplication by scalar t(s,v)=(ts, tv) 68

69 You Might Need To Invert q Recall: q & -q represent the same rotation Given q0 and q1, test the angle (in 4D) If dot product of q 0 and q1 is negative, they are on opposite sides of the hypersphere, and interpolation will take the longer route (red) If this is the case, just use -q1 instead of q1 q0 q1 69

70 Slerp: Sanity Check Interpolate between identity (q0) and rotation around v (q1) q0=(1; 0) q1 = (cos(θ/2); v sin(θ/2)) [ (1, 0) sin((1-t) θ) + (cos(θ/2); v sin(θ/2)) sin (tθ) ]/sin(θ) = (sin(θ-tθ)+cos(θ/2)sin(tθ); v sin(θ/2) sin (tθ))/sin(θ) See if you can use your trig skillz to get from the sin (θ-tθ)=sinθ cos(tθ) - cosθ sin(tθ) sinθ cos(tθ)-cosθ sin(tθ)+cos(θ/2)sin(tθ) above to the goal cos(tθ)+cos(θ/2)-sin(tθ) cosθ/sinθ cos^2(tθ/2)-sin^2(tθ/2) (cos(θt/2); v sin(θt/2)) 70

71 Problem with Splines Slerp only works to interpolate between two positions For splines, we need to blend more, typically 4 (for cubics) t=t3 v u t=t2 t=t1 n 71

72 De Casteljau Construction Remember what we did with planar cubic Bézier curves Works to construct a point at any t Only requires interpolation between pairs of points Do slerp between pairs of key quaternions q3 slerp(q2, q3, t) q2 t t slerp t slerp t slerp t slerp(q3, q4, t) slerp(q1, q2, t) t q1 q4 72

73 This is an easy extra in Assignment 2 73

74 Extensions Better interpolation E.g. minimize acceleration, velocity constraint id=218486&dl=acm&coll=portal&cfid= &cftoken= id=134086&dl=acm&coll=portal&cfid= &cftoken= From Kim et al

75 Questions? Recap 1D rotation: unit complex number slerp 3D rotation: unit quaternions q = (cos(θ/2); v sin(θ/2)) represents rotation of θ around axis v slerp just works directly Splines constructed with De Casteljau Demos at /vq/index.html 75

76 Cookbook Recipe You need matrices to draw (e.g. OpenGL) General approach for 3 DOF rotations Store keyframe orientations as quaternions Interpolate between them using slerp (pairwise) or slerp + De Casteljau (splines) Convert to quaternion to matrix Profit. (Or, store matrices, convert to quaternions for interpolation, then convert back.) 76

77 Cookbook Recipe You need matrices to draw (e.g. OpenGL) General approach for 3 DOF rotations Store keyframe orientations as quaternions Interpolate between them using slerp (pairwise) or slerp + De Casteljau (splines) Convert to quaternion to matrix Profit. Often need to convert from matrix to quaternion. Next: Conversion to/from matrices. 77

78 Quaternion to Rotation Matrix Quaternion (q0, q1, q2, q3) corresponds to matrix 1 2q2 2 2q3 2 2(q 1 q 2 q 3 q 0 ) 2(q 1 q 3 + q 2 q 0 ) 2(q 1 q 2 + q 3 q 0 ) 1 2q1 2 2q3 2 2(q 2 q 3 q 1 q 0 ) 2(q 1 q 3 q 2 q 0 ) 2(q 1 q 0 + q 2 q 3 ) 1 2q1 2 2q2 2 Similar to Rodrigues rotation formula but recall that quaternions use θ/2 After conversion, you can combine rotations and other affine/projective transforms 78

79 3x3 Orthonormal Matrix to Quaternion More challenging (first of all, not all Ms are rotations) if M is a rotation, trace(m)>0 then you get quaternion (s, x, y, z) through: s = sqrt (1 + M 11 + M22 + M33) /2 x = (M 23 - M32) / ( 4 * s) y = (M31 - M13) / ( 4 * s) z = (M12 - M21) / ( 4 * s) if trace(m)<0, need some permutation/sign changes Code at e.g. conversions/matrixtoquaternion/index.htm

80 General Conversion Resource %28mathematics%29 80

81 What about other transforms? What to do if the matrix to be interpolated does not only rotation, but scale, shear, etc.? 81

82 Non-orthonormal 3x3 matrix Polar decomposition breaks arbitrary matrix M into Rotation Q (+potential reflection) Symmetric positive definite S (anisotropic scale) Extract rotation part Q, interpolate it using quaternions Interpolate S using some other method. Shoemake, K. and Duff, T Matrix animation and polar decomposition. In Proceedings of the Conference on Graphics interface '92, pp

83 Polar Decomposition Algorithm Given 3x3 Matrix M Compute the rotation factor Q by averaging the matrix with its inverse transpose until convergence: Set Q 0 = M, then Qi+1 = 1/2(Qi+ Qi T ) until Qi+1 Qi 0. 83

84 Questions? Recap 1D rotation: unit complex number slerp 3D rotation: unit 4D quaternions q = (cos(θ/2); v sin(θ/2)) represents rotation of θ around axis v slerp just works directly De Casteljeau for splines Conversion with matrices Polar decomposition if not orthonormal Demos at /vq/index.html 84

85 More Quaternion Magic: Multiplication Turns out that quaternion multiplication corresponds to composing rotations That is, q2 = q1q0 is equivalent to first rotating by q0, then q1. ( ; v)( ; v )= ( v v ; v + v + v v ) Multiplication is not commutative (why? cross product) q 1q0 does not equal q0q1 except in special cases Makes sense, rotations are not commutative either Verifications Check the formula, remembering the funky multiplication rules from the definitions. (Or, then just trust me. I m not going to ask you to do this in quiz.) 85

86 Even More Quaternion Magic: Conjugate and Inverse Let s define a conjugate q* = (θ, -v) Remember complex conjugate? a = x + iy, a* = x - iy Is there an inverse quaternion q -1 such that qq -1 =(1; 0) for unit q? Let s try the conjugate... Again, compare to complex: aa* = x 2 +y 2 = 1 when a is unit length. ( ; v)( ; v )= ( v v ; v + v + v v ) 86

87 Even More Quaternion Magic: Conjugate and Inverse Let s define a conjugate q* = (θ, -v) Remember complex conjugate? a = x + iy, a* = x - iy Is there an inverse quaternion q -1 such that qq -1 =(1; 0) for unit q? Let s try the conjugate... Again, compare to complex: aa* = x 2 +y 2 = 1 when a is unit length. Let s see: qq = ( 2 + v v; v v + v v) = (1; 0) Note that this only works for unit q. If not unit, need normalization factor. ( ; v)( ; v )= ( v v ; v + v + v v ) 87

88 Even More Quaternion Magic: Conjugate and Inverse Let s define a conjugate q* = (θ, -v) Remember complex conjugate? a = x + iy, a* = x - iy Is there an inverse quaternion q -1 such that qq -1 =(1; 0) for unit q? Let s try the conjugate... Again, compare to complex: aa* = x 2 +y 2 = 1 when a is unit length. Let s see: qq = q* = q -1 for unit quaternions ( 2 + v v; v v + v v) = (1; 0) Note that this only works for unit q. If not unit, need normalization factor. ( ; v)( ; v )= ( v v ; v + v + v v ) 88

89 Inverse & Conjugate: Geometry θ v q = (cos θ/2; sinθ/2 v) represents a rotation of angle θ around v Inverse rotation q -1 : Angle -θ around v Angle θ around v -θ In both cases, leads to (cos θ/2; -sinθ/2 v) q* = (θ, -v), remember 89

90 Inverse & Conjugates: Matrices What is the inverse of a rotation matrix? 90

91 Inverse & Conjugates: Matrices What is the inverse of a rotation matrix? The conjugate/transpose matrix For a rotation (or any orthonormal matrix) MT M=I (Formally, to get the conjugate of a complex-valued matrix, take the transpose and the conjugate of each coefficient. But we don t care here.) The notion of conjugation is related between matrices & quaternions Isn t that cool? 91

92 Even More 4D Magic: Rotating a Point 3D vector p is represented by the quaternion (0, p) To rotate 3D point/vector p by rotation/quaternion q, compute qpq -1 = q(0; p)q -1 92

93 Even More 4D Magic: Rotating a Point 3D vector p is represented by the quaternion (0, p) To rotate 3D point/vector p by rotation/quaternion q, compute qpq -1 = q(0; p)q -1 In practice, it s better to convert the quaternion to a matrix. You can combine with other linear transformation then 93

94 That s All For Today Coming up: Computer Animation I 94

95 Question? 95

96 Fun: Mandelbrot & Julia set For each pixel at coordinate c 0 series: c n+1 =c n2 +c where c is a constant same for the whole image for Julia sets One image per c c=x+iy for each 2D point for Mandelbrot Set = set of pixels where the series does not diverge Can be colored according to how fast it diverges Julia sets for two different c

97 Fun: Julia sets in quaternion space Same kind of series, but quaternions instead of complex a slice can be visualized in 3D the full 4D thing leads to nice animations 97

98 More Fun Julia Sets in Quaternion space Pascal Massimino

Computer Animation II

Computer Animation II Computer Animation II Orientation interpolation Dynamics Some slides courtesy of Leonard McMillan and Jovan Popovic Lecture 13 6.837 Fall 2002 Interpolation Review from Thursday Splines Articulated bodies

More information

CS354 Computer Graphics Rotations and Quaternions

CS354 Computer Graphics Rotations and Quaternions Slide Credit: Don Fussell CS354 Computer Graphics Rotations and Quaternions Qixing Huang April 4th 2018 Orientation Position and Orientation The position of an object can be represented as a translation

More information

Orientation & Quaternions

Orientation & Quaternions Orientation & Quaternions Orientation Position and Orientation The position of an object can be represented as a translation of the object from the origin The orientation of an object can be represented

More information

Computer Animation Fundamentals. Animation Methods Keyframing Interpolation Kinematics Inverse Kinematics

Computer Animation Fundamentals. Animation Methods Keyframing Interpolation Kinematics Inverse Kinematics Computer Animation Fundamentals Animation Methods Keyframing Interpolation Kinematics Inverse Kinematics Lecture 21 6.837 Fall 2001 Conventional Animation Draw each frame of the animation great control

More information

CS612 - Algorithms in Bioinformatics

CS612 - Algorithms in Bioinformatics Fall 2017 Structural Manipulation November 22, 2017 Rapid Structural Analysis Methods Emergence of large structural databases which do not allow manual (visual) analysis and require efficient 3-D search

More information

Quaternions and Rotations

Quaternions and Rotations CSCI 520 Computer Animation and Simulation Quaternions and Rotations Jernej Barbic University of Southern California 1 Rotations Very important in computer animation and robotics Joint angles, rigid body

More information

Animation. Keyframe animation. CS4620/5620: Lecture 30. Rigid motion: the simplest deformation. Controlling shape for animation

Animation. Keyframe animation. CS4620/5620: Lecture 30. Rigid motion: the simplest deformation. Controlling shape for animation Keyframe animation CS4620/5620: Lecture 30 Animation Keyframing is the technique used for pose-to-pose animation User creates key poses just enough to indicate what the motion is supposed to be Interpolate

More information

12.1 Quaternions and Rotations

12.1 Quaternions and Rotations Fall 2015 CSCI 420 Computer Graphics 12.1 Quaternions and Rotations Hao Li http://cs420.hao-li.com 1 Rotations Very important in computer animation and robotics Joint angles, rigid body orientations, camera

More information

Visual Recognition: Image Formation

Visual Recognition: Image Formation Visual Recognition: Image Formation Raquel Urtasun TTI Chicago Jan 5, 2012 Raquel Urtasun (TTI-C) Visual Recognition Jan 5, 2012 1 / 61 Today s lecture... Fundamentals of image formation You should know

More information

Quaternions and Rotations

Quaternions and Rotations CSCI 520 Computer Animation and Simulation Quaternions and Rotations Jernej Barbic University of Southern California 1 Rotations Very important in computer animation and robotics Joint angles, rigid body

More information

CS 445 / 645 Introduction to Computer Graphics. Lecture 21 Representing Rotations

CS 445 / 645 Introduction to Computer Graphics. Lecture 21 Representing Rotations CS 445 / 645 Introduction to Computer Graphics Lecture 21 Representing Rotations Parameterizing Rotations Straightforward in 2D A scalar, θ, represents rotation in plane More complicated in 3D Three scalars

More information

Animating orientation. CS 448D: Character Animation Prof. Vladlen Koltun Stanford University

Animating orientation. CS 448D: Character Animation Prof. Vladlen Koltun Stanford University Animating orientation CS 448D: Character Animation Prof. Vladlen Koltun Stanford University Orientation in the plane θ (cos θ, sin θ) ) R θ ( x y = sin θ ( cos θ sin θ )( x y ) cos θ Refresher: Homogenous

More information

Visualizing Quaternions

Visualizing Quaternions Visualizing Quaternions Andrew J. Hanson Computer Science Department Indiana University Siggraph 25 Tutorial OUTLINE I: (45min) Twisting Belts, Rolling Balls, and Locking Gimbals: Explaining Rotation Sequences

More information

3D Rotations and Complex Representations. Computer Graphics CMU /15-662, Fall 2017

3D Rotations and Complex Representations. Computer Graphics CMU /15-662, Fall 2017 3D Rotations and Complex Representations Computer Graphics CMU 15-462/15-662, Fall 2017 Rotations in 3D What is a rotation, intuitively? How do you know a rotation when you see it? - length/distance is

More information

Quaternions and Rotations

Quaternions and Rotations CSCI 420 Computer Graphics Lecture 20 and Rotations Rotations Motion Capture [Angel Ch. 3.14] Rotations Very important in computer animation and robotics Joint angles, rigid body orientations, camera parameters

More information

Quaternions and Rotations

Quaternions and Rotations CSCI 480 Computer Graphics Lecture 20 and Rotations April 6, 2011 Jernej Barbic Rotations Motion Capture [Ch. 4.12] University of Southern California http://www-bcf.usc.edu/~jbarbic/cs480-s11/ 1 Rotations

More information

CALCULATING TRANSFORMATIONS OF KINEMATIC CHAINS USING HOMOGENEOUS COORDINATES

CALCULATING TRANSFORMATIONS OF KINEMATIC CHAINS USING HOMOGENEOUS COORDINATES CALCULATING TRANSFORMATIONS OF KINEMATIC CHAINS USING HOMOGENEOUS COORDINATES YINGYING REN Abstract. In this paper, the applications of homogeneous coordinates are discussed to obtain an efficient model

More information

Animation. CS 4620 Lecture 32. Cornell CS4620 Fall Kavita Bala

Animation. CS 4620 Lecture 32. Cornell CS4620 Fall Kavita Bala Animation CS 4620 Lecture 32 Cornell CS4620 Fall 2015 1 What is animation? Modeling = specifying shape using all the tools we ve seen: hierarchies, meshes, curved surfaces Animation = specifying shape

More information

CMSC 425: Lecture 6 Affine Transformations and Rotations

CMSC 425: Lecture 6 Affine Transformations and Rotations CMSC 45: Lecture 6 Affine Transformations and Rotations Affine Transformations: So far we have been stepping through the basic elements of geometric programming. We have discussed points, vectors, and

More information

Rotations in 3D Graphics and the Gimbal Lock

Rotations in 3D Graphics and the Gimbal Lock Rotations in 3D Graphics and the Gimbal Lock Valentin Koch Autodesk Inc. January 27, 2016 Valentin Koch (ADSK) IEEE Okanagan January 27, 2016 1 / 37 Presentation Road Map 1 Introduction 2 Rotation Matrices

More information

Part II: OUTLINE. Visualizing Quaternions. Part II: Visualizing Quaternion Geometry. The Spherical Projection Trick: Visualizing unit vectors.

Part II: OUTLINE. Visualizing Quaternions. Part II: Visualizing Quaternion Geometry. The Spherical Projection Trick: Visualizing unit vectors. Visualizing Quaternions Part II: Visualizing Quaternion Geometry Andrew J. Hanson Indiana University Part II: OUTLINE The Spherical Projection Trick: Visualizing unit vectors. Quaternion Frames Quaternion

More information

3D Kinematics. Consists of two parts

3D Kinematics. Consists of two parts D Kinematics Consists of two parts D rotation D translation The same as D D rotation is more complicated than D rotation (restricted to z-ais) Net, we will discuss the treatment for spatial (D) rotation

More information

Motivation. Parametric Curves (later Surfaces) Outline. Tangents, Normals, Binormals. Arclength. Advanced Computer Graphics (Fall 2010)

Motivation. Parametric Curves (later Surfaces) Outline. Tangents, Normals, Binormals. Arclength. Advanced Computer Graphics (Fall 2010) Advanced Computer Graphics (Fall 2010) CS 283, Lecture 19: Basic Geometric Concepts and Rotations Ravi Ramamoorthi http://inst.eecs.berkeley.edu/~cs283/fa10 Motivation Moving from rendering to simulation,

More information

3D Transformations and Complex Representations. Computer Graphics CMU /15-662, Fall 2016

3D Transformations and Complex Representations. Computer Graphics CMU /15-662, Fall 2016 3D Transformations and Complex Representations Computer Graphics CMU 15-462/15-662, Fall 2016 Quiz 4: Trees and Transformations Student solutions (beautiful!): Rotations in 3D What is a rotation, intuitively?

More information

Vector Algebra Transformations. Lecture 4

Vector Algebra Transformations. Lecture 4 Vector Algebra Transformations Lecture 4 Cornell CS4620 Fall 2008 Lecture 4 2008 Steve Marschner 1 Geometry A part of mathematics concerned with questions of size, shape, and relative positions of figures

More information

Geometric Transformations

Geometric Transformations Geometric Transformations CS 4620 Lecture 9 2017 Steve Marschner 1 A little quick math background Notation for sets, functions, mappings Linear and affine transformations Matrices Matrix-vector multiplication

More information

Transformations: 2D Transforms

Transformations: 2D Transforms 1. Translation Transformations: 2D Transforms Relocation of point WRT frame Given P = (x, y), translation T (dx, dy) Then P (x, y ) = T (dx, dy) P, where x = x + dx, y = y + dy Using matrix representation

More information

Transformations Week 9, Lecture 18

Transformations Week 9, Lecture 18 CS 536 Computer Graphics Transformations Week 9, Lecture 18 2D Transformations David Breen, William Regli and Maxim Peysakhov Department of Computer Science Drexel University 1 3 2D Affine Transformations

More information

Math background. 2D Geometric Transformations. Implicit representations. Explicit representations. Read: CS 4620 Lecture 6

Math background. 2D Geometric Transformations. Implicit representations. Explicit representations. Read: CS 4620 Lecture 6 Math background 2D Geometric Transformations CS 4620 Lecture 6 Read: Chapter 2: Miscellaneous Math Chapter 5: Linear Algebra Notation for sets, functions, mappings Linear transformations Matrices Matrix-vector

More information

IMAGE-BASED RENDERING AND ANIMATION

IMAGE-BASED RENDERING AND ANIMATION DH2323 DGI17 INTRODUCTION TO COMPUTER GRAPHICS AND INTERACTION IMAGE-BASED RENDERING AND ANIMATION Christopher Peters CST, KTH Royal Institute of Technology, Sweden chpeters@kth.se http://kth.academia.edu/christopheredwardpeters

More information

METR 4202: Advanced Control & Robotics

METR 4202: Advanced Control & Robotics Position & Orientation & State t home with Homogenous Transformations METR 4202: dvanced Control & Robotics Drs Surya Singh, Paul Pounds, and Hanna Kurniawati Lecture # 2 July 30, 2012 metr4202@itee.uq.edu.au

More information

Graphics and Interaction Transformation geometry and homogeneous coordinates

Graphics and Interaction Transformation geometry and homogeneous coordinates 433-324 Graphics and Interaction Transformation geometry and homogeneous coordinates Department of Computer Science and Software Engineering The Lecture outline Introduction Vectors and matrices Translation

More information

COMP30019 Graphics and Interaction Transformation geometry and homogeneous coordinates

COMP30019 Graphics and Interaction Transformation geometry and homogeneous coordinates COMP30019 Graphics and Interaction Transformation geometry and homogeneous coordinates Department of Computer Science and Software Engineering The Lecture outline Introduction Vectors and matrices Translation

More information

3D Transformations. CS 4620 Lecture Kavita Bala w/ prior instructor Steve Marschner. Cornell CS4620 Fall 2015 Lecture 11

3D Transformations. CS 4620 Lecture Kavita Bala w/ prior instructor Steve Marschner. Cornell CS4620 Fall 2015 Lecture 11 3D Transformations CS 4620 Lecture 11 1 Announcements A2 due tomorrow Demos on Monday Please sign up for a slot Post on piazza 2 Translation 3 Scaling 4 Rotation about z axis 5 Rotation about x axis 6

More information

Quaternion Rotations AUI Course Denbigh Starkey

Quaternion Rotations AUI Course Denbigh Starkey Major points of these notes: Quaternion Rotations AUI Course Denbigh Starkey. What I will and won t be doing. Definition of a quaternion and notation 3 3. Using quaternions to rotate any point around an

More information

Animation. CS 4620 Lecture 33. Cornell CS4620 Fall Kavita Bala

Animation. CS 4620 Lecture 33. Cornell CS4620 Fall Kavita Bala Animation CS 4620 Lecture 33 Cornell CS4620 Fall 2015 1 Announcements Grading A5 (and A6) on Monday after TG 4621: one-on-one sessions with TA this Friday w/ prior instructor Steve Marschner 2 Quaternions

More information

Visualizing Quaternions

Visualizing Quaternions Visualizing Quaternions Andrew J. Hanson Computer Science Department Indiana University Siggraph 1 Tutorial 1 GRAND PLAN I: Fundamentals of Quaternions II: Visualizing Quaternion Geometry III: Quaternion

More information

Quaternions & Rotation in 3D Space

Quaternions & Rotation in 3D Space Quaternions & Rotation in 3D Space 1 Overview Quaternions: definition Quaternion properties Quaternions and rotation matrices Quaternion-rotation matrices relationship Spherical linear interpolation Concluding

More information

3D Transformations World Window to Viewport Transformation Week 2, Lecture 4

3D Transformations World Window to Viewport Transformation Week 2, Lecture 4 CS 430/536 Computer Graphics I 3D Transformations World Window to Viewport Transformation Week 2, Lecture 4 David Breen, William Regli and Maxim Peysakhov Geometric and Intelligent Computing Laboratory

More information

MTRX4700 Experimental Robotics

MTRX4700 Experimental Robotics MTRX 4700 : Experimental Robotics Lecture 2 Stefan B. Williams Slide 1 Course Outline Week Date Content Labs Due Dates 1 5 Mar Introduction, history & philosophy of robotics 2 12 Mar Robot kinematics &

More information

Lecture Note 3: Rotational Motion

Lecture Note 3: Rotational Motion ECE5463: Introduction to Robotics Lecture Note 3: Rotational Motion Prof. Wei Zhang Department of Electrical and Computer Engineering Ohio State University Columbus, Ohio, USA Spring 2018 Lecture 3 (ECE5463

More information

Applications of Dual Quaternions in Three Dimensional Transformation and Interpolation

Applications of Dual Quaternions in Three Dimensional Transformation and Interpolation Applications of Dual Quaternions in Three Dimensional Transformation and Interpolation November 11, 2013 Matthew Smith mrs126@uclive.ac.nz Department of Computer Science and Software Engineering University

More information

3D Transformations. CS 4620 Lecture 10. Cornell CS4620 Fall 2014 Lecture Steve Marschner (with previous instructors James/Bala)

3D Transformations. CS 4620 Lecture 10. Cornell CS4620 Fall 2014 Lecture Steve Marschner (with previous instructors James/Bala) 3D Transformations CS 4620 Lecture 10 1 Translation 2 Scaling 3 Rotation about z axis 4 Rotation about x axis 5 Rotation about y axis 6 Properties of Matrices Translations: linear part is the identity

More information

Fundamentals of Computer Animation

Fundamentals of Computer Animation Fundamentals of Computer Animation Quaternions as Orientations () page 1 Multiplying Quaternions q1 = (w1, x1, y1, z1); q = (w, x, y, z); q1 * q = ( w1.w - v1.v, w1.v + w.v1 + v1 X v) where v1 = (x1, y1,

More information

3D Modelling: Animation Fundamentals & Unit Quaternions

3D Modelling: Animation Fundamentals & Unit Quaternions 3D Modelling: Animation Fundamentals & Unit Quaternions CITS3003 Graphics & Animation Thanks to both Richard McKenna and Marco Gillies for permission to use their slides as a base. Static objects are boring

More information

CS184: Using Quaternions to Represent Rotation

CS184: Using Quaternions to Represent Rotation Page 1 of 5 CS 184 home page A note on these notes: These notes on quaternions were created as a resource for students taking CS184 at UC Berkeley. I am not doing any research related to quaternions and

More information

2D/3D Geometric Transformations and Scene Graphs

2D/3D Geometric Transformations and Scene Graphs 2D/3D Geometric Transformations and Scene Graphs Week 4 Acknowledgement: The course slides are adapted from the slides prepared by Steve Marschner of Cornell University 1 A little quick math background

More information

Quaternions and Euler Angles

Quaternions and Euler Angles Quaternions and Euler Angles Revision #1 This document describes how the VR Audio Kit handles the orientation of the 3D Sound One headset using quaternions and Euler angles, and how to convert between

More information

ME 597: AUTONOMOUS MOBILE ROBOTICS SECTION 2 COORDINATE TRANSFORMS. Prof. Steven Waslander

ME 597: AUTONOMOUS MOBILE ROBOTICS SECTION 2 COORDINATE TRANSFORMS. Prof. Steven Waslander ME 597: AUTONOMOUS MOILE ROOTICS SECTION 2 COORDINATE TRANSFORMS Prof. Steven Waslander OUTLINE Coordinate Frames and Transforms Rotation Matrices Euler Angles Quaternions Homogeneous Transforms 2 COORDINATE

More information

Quaternions and Exponentials

Quaternions and Exponentials Quaternions and Exponentials Michael Kazhdan (601.457/657) HB A.6 FvDFH 21.1.3 Announcements OpenGL review II: Today at 9:00pm, Malone 228 This week's graphics reading seminar: Today 2:00-3:00pm, my office

More information

Transformations. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

Transformations. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico Transformations Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico Angel: Interactive Computer Graphics 4E Addison-Wesley 25 1 Objectives

More information

Linear algebra deals with matrixes: two-dimensional arrays of values. Here s a matrix: [ x + 5y + 7z 9x + 3y + 11z

Linear algebra deals with matrixes: two-dimensional arrays of values. Here s a matrix: [ x + 5y + 7z 9x + 3y + 11z Basic Linear Algebra Linear algebra deals with matrixes: two-dimensional arrays of values. Here s a matrix: [ 1 5 ] 7 9 3 11 Often matrices are used to describe in a simpler way a series of linear equations.

More information

Animation and Quaternions

Animation and Quaternions Animation and Quaternions Partially based on slides by Justin Solomon: http://graphics.stanford.edu/courses/cs148-1-summer/assets/lecture_slides/lecture14_animation_techniques.pdf 1 Luxo Jr. Pixar 1986

More information

Autonomous Navigation for Flying Robots

Autonomous Navigation for Flying Robots Computer Vision Group Prof. Daniel Cremers Autonomous Navigation for Flying Robots Lecture 3.1: 3D Geometry Jürgen Sturm Technische Universität München Points in 3D 3D point Augmented vector Homogeneous

More information

Animation Curves and Splines 2

Animation Curves and Splines 2 Animation Curves and Splines 2 Animation Homework Set up Thursday a simple avatar E.g. cube/sphere (or square/circle if 2D) Specify some key frames (positions/orientations) Associate Animation a time with

More information

Today. Parity. General Polygons? Non-Zero Winding Rule. Winding Numbers. CS559 Lecture 11 Polygons, Transformations

Today. Parity. General Polygons? Non-Zero Winding Rule. Winding Numbers. CS559 Lecture 11 Polygons, Transformations CS559 Lecture Polygons, Transformations These are course notes (not used as slides) Written by Mike Gleicher, Oct. 005 With some slides adapted from the notes of Stephen Chenney Final version (after class)

More information

Rotation and Orientation: Fundamentals. Perelyaev Sergei VARNA, 2011

Rotation and Orientation: Fundamentals. Perelyaev Sergei VARNA, 2011 Rotation and Orientation: Fundamentals Perelyaev Sergei VARNA, 0 What is Rotation? Not intuitive Formal definitions are also confusing Many different ways to describe Rotation (direction cosine) matri

More information

θ x Week Date Lecture (M: 2:05p-3:50, 50-N202) 1 23-Jul Introduction + Representing Position & Orientation & State 2 30-Jul

θ x Week Date Lecture (M: 2:05p-3:50, 50-N202) 1 23-Jul Introduction + Representing Position & Orientation & State 2 30-Jul θ x 2018 School of Information Technology and Electrical Engineering at the University of Queensland Lecture Schedule Week Date Lecture (M: 2:05p-3:50, 50-N202) 1 23-Jul Introduction + Representing Position

More information

CS770/870 Spring 2017 Quaternions

CS770/870 Spring 2017 Quaternions CS770/870 Spring 2017 Quaternions Primary resources used in preparing these notes: 1. van Osten, 3D Game Engine Programming: Understanding Quaternions, https://www.3dgep.com/understanding-quaternions 2.

More information

Chapter 3 : Computer Animation

Chapter 3 : Computer Animation Chapter 3 : Computer Animation Histor First animation films (Disne) 30 drawings / second animator in chief : ke frames others : secondar drawings Use the computer to interpolate? positions orientations

More information

CS 475 / CS 675 Computer Graphics. Lecture 16 : Interpolation for Animation

CS 475 / CS 675 Computer Graphics. Lecture 16 : Interpolation for Animation CS 475 / CS 675 Computer Graphics Lecture 16 : Interpolation for Keyframing Selected (key) frames are specified. Interpolation of intermediate frames. Simple and popular approach. May give incorrect (inconsistent)

More information

Rotation with Quaternions

Rotation with Quaternions Rotation with Quaternions Contents 1 Introduction 1.1 Translation................... 1. Rotation..................... 3 Quaternions 5 3 Rotations Represented as Quaternions 6 3.1 Dynamics....................

More information

Rotations (and other transformations) Rotation as rotation matrix. Storage. Apply to vector matrix vector multiply (15 flops)

Rotations (and other transformations) Rotation as rotation matrix. Storage. Apply to vector matrix vector multiply (15 flops) Cornell University CS 569: Interactive Computer Graphics Rotations (and other transformations) Lecture 4 2008 Steve Marschner 1 Rotation as rotation matrix 9 floats orthogonal and unit length columns and

More information

Animation. Computer Graphics COMP 770 (236) Spring Instructor: Brandon Lloyd 4/23/07 1

Animation. Computer Graphics COMP 770 (236) Spring Instructor: Brandon Lloyd 4/23/07 1 Animation Computer Graphics COMP 770 (236) Spring 2007 Instructor: Brandon Lloyd 4/23/07 1 Today s Topics Interpolation Forward and inverse kinematics Rigid body simulation Fluids Particle systems Behavioral

More information

2D and 3D Transformations AUI Course Denbigh Starkey

2D and 3D Transformations AUI Course Denbigh Starkey 2D and 3D Transformations AUI Course Denbigh Starkey. Introduction 2 2. 2D transformations using Cartesian coordinates 3 2. Translation 3 2.2 Rotation 4 2.3 Scaling 6 3. Introduction to homogeneous coordinates

More information

Animations. Hakan Bilen University of Edinburgh. Computer Graphics Fall Some slides are courtesy of Steve Marschner and Kavita Bala

Animations. Hakan Bilen University of Edinburgh. Computer Graphics Fall Some slides are courtesy of Steve Marschner and Kavita Bala Animations Hakan Bilen University of Edinburgh Computer Graphics Fall 2017 Some slides are courtesy of Steve Marschner and Kavita Bala Animation Artistic process What are animators trying to do? What tools

More information

Why animate humans? Why is this hard? Aspects of the Problem. These lectures. Animation Apreciation 101

Why animate humans? Why is this hard? Aspects of the Problem. These lectures. Animation Apreciation 101 Animation by Example Lecture 1: Introduction, Human Representation Michael Gleicher University of Wisconsin- Madison www.cs.wisc.edu/~gleicher www.cs.wisc.edu/graphics Why animate humans? Movies Television

More information

Advanced Computer Graphics Transformations. Matthias Teschner

Advanced Computer Graphics Transformations. Matthias Teschner Advanced Computer Graphics Transformations Matthias Teschner Motivation Transformations are used To convert between arbitrary spaces, e.g. world space and other spaces, such as object space, camera space

More information

a a= a a =a a 1 =1 Division turned out to be equivalent to multiplication: a b= a b =a 1 b

a a= a a =a a 1 =1 Division turned out to be equivalent to multiplication: a b= a b =a 1 b MATH 245 Extra Effort ( points) My assistant read through my first draft, got half a page in, and skipped to the end. So I will save you the flipping. Here is the assignment. Do just one of them. All the

More information

Coordinate Frames and Transforms

Coordinate Frames and Transforms Coordinate Frames and Transforms 1 Specifiying Position and Orientation We need to describe in a compact way the position of the robot. In 2 dimensions (planar mobile robot), there are 3 degrees of freedom

More information

To do this the end effector of the robot must be correctly positioned relative to the work piece.

To do this the end effector of the robot must be correctly positioned relative to the work piece. Spatial Descriptions and Transformations typical robotic task is to grasp a work piece supplied by a conveyer belt or similar mechanism in an automated manufacturing environment, transfer it to a new position

More information

For each question, indicate whether the statement is true or false by circling T or F, respectively.

For each question, indicate whether the statement is true or false by circling T or F, respectively. True/False For each question, indicate whether the statement is true or false by circling T or F, respectively. 1. (T/F) Rasterization occurs before vertex transformation in the graphics pipeline. 2. (T/F)

More information

Transforms. COMP 575/770 Spring 2013

Transforms. COMP 575/770 Spring 2013 Transforms COMP 575/770 Spring 2013 Transforming Geometry Given any set of points S Could be a 2D shape, a 3D object A transform is a function T that modifies all points in S: T S S T v v S Different transforms

More information

Animation. Traditional Animation Keyframe Animation. Interpolating Rotation Forward/Inverse Kinematics

Animation. Traditional Animation Keyframe Animation. Interpolating Rotation Forward/Inverse Kinematics Animation Traditional Animation Keyframe Animation Interpolating Rotation Forward/Inverse Kinematics Overview Animation techniques Performance-based (motion capture) Traditional animation (frame-by-frame)

More information

Inertial Measurement Units II!

Inertial Measurement Units II! ! Inertial Measurement Units II! Gordon Wetzstein! Stanford University! EE 267 Virtual Reality! Lecture 10! stanford.edu/class/ee267/!! wikipedia! Polynesian Migration! Lecture Overview! short review of

More information

Today. Today. Introduction. Matrices. Matrices. Computergrafik. Transformations & matrices Introduction Matrices

Today. Today. Introduction. Matrices. Matrices. Computergrafik. Transformations & matrices Introduction Matrices Computergrafik Matthias Zwicker Universität Bern Herbst 2008 Today Transformations & matrices Introduction Matrices Homogeneous Affine transformations Concatenating transformations Change of Common coordinate

More information

Fundamentals of Computer Animation

Fundamentals of Computer Animation Fundamentals of Computer Animation Orientation and Rotation University of Calgary GraphicsJungle Project CPSC 587 5 page Motivation Finding the most natural and compact way to present rotation and orientations

More information

Fundamentals of 3D. Lecture 3: Debriefing: Lecture 2 Rigid transformations Quaternions Iterative Closest Point (+Kd-trees)

Fundamentals of 3D. Lecture 3: Debriefing: Lecture 2 Rigid transformations Quaternions Iterative Closest Point (+Kd-trees) INF555 Fundamentals of 3D Lecture 3: Debriefing: Lecture 2 Rigid transformations Quaternions Iterative Closest Point (+Kd-trees) Frank Nielsen nielsen@lix.polytechnique.fr Harris-Stephens' combined corner/edge

More information

Transformation. Jane Li Assistant Professor Mechanical Engineering & Robotics Engineering

Transformation. Jane Li Assistant Professor Mechanical Engineering & Robotics Engineering RBE 550 MOTION PLANNING BASED ON DR. DMITRY BERENSON S RBE 550 Transformation Jane Li Assistant Professor Mechanical Engineering & Robotics Engineering http://users.wpi.edu/~zli11 Announcement Project

More information

Rotation parameters for model building and stable parameter inversion in orthorhombic media Cintia Lapilli* and Paul J. Fowler, WesternGeco.

Rotation parameters for model building and stable parameter inversion in orthorhombic media Cintia Lapilli* and Paul J. Fowler, WesternGeco. otation parameters for model building and stable parameter inversion in orthorhombic media Cintia Lapilli* and Paul J Fowler, WesternGeco Summary Symmetry groups commonly used to describe seismic anisotropy

More information

3D Game Engine Programming. Understanding Quaternions. Helping you build your dream game engine. Posted on June 25, 2012 by Jeremiah van Oosten

3D Game Engine Programming. Understanding Quaternions. Helping you build your dream game engine. Posted on June 25, 2012 by Jeremiah van Oosten 3D Game Engine Programming Helping you build your dream game engine. Understanding Quaternions Posted on June 25, 2012 by Jeremiah van Oosten Understanding Quaternions In this article I will attempt to

More information

GEOMETRIC TRANSFORMATIONS AND VIEWING

GEOMETRIC TRANSFORMATIONS AND VIEWING GEOMETRIC TRANSFORMATIONS AND VIEWING 2D and 3D 1/44 2D TRANSFORMATIONS HOMOGENIZED Transformation Scaling Rotation Translation Matrix s x s y cosθ sinθ sinθ cosθ 1 dx 1 dy These 3 transformations are

More information

Jorg s Graphics Lecture Notes Coordinate Spaces 1

Jorg s Graphics Lecture Notes Coordinate Spaces 1 Jorg s Graphics Lecture Notes Coordinate Spaces Coordinate Spaces Computer Graphics: Objects are rendered in the Euclidean Plane. However, the computational space is better viewed as one of Affine Space

More information

Vector Calculus: Understanding the Cross Product

Vector Calculus: Understanding the Cross Product University of Babylon College of Engineering Mechanical Engineering Dept. Subject : Mathematics III Class : 2 nd year - first semester Date: / 10 / 2016 2016 \ 2017 Vector Calculus: Understanding the Cross

More information

Reading. Topics in Articulated Animation. Character Representation. Animation. q i. t 1 t 2. Articulated models: Character Models are rich, complex

Reading. Topics in Articulated Animation. Character Representation. Animation. q i. t 1 t 2. Articulated models: Character Models are rich, complex Shoemake, Quaternions Tutorial Reading Topics in Articulated Animation 2 Articulated models: rigid parts connected by joints Animation They can be animated by specifying the joint angles (or other display

More information

Quaternion to Euler Angle Conversion for Arbitrary Rotation Sequence Using Geometric Methods

Quaternion to Euler Angle Conversion for Arbitrary Rotation Sequence Using Geometric Methods uaternion to Euler Angle Conversion for Arbitrary Rotation Sequence Using Geometric Methods ê = normalized Euler ation axis i Noel H. Hughes Nomenclature = indices of first, second and third Euler

More information

Kinematics, Kinematics Chains CS 685

Kinematics, Kinematics Chains CS 685 Kinematics, Kinematics Chains CS 685 Previously Representation of rigid body motion Two different interpretations - as transformations between different coord. frames - as operators acting on a rigid body

More information

SUMMARY. CS380: Introduction to Computer Graphics Track-/Arc-ball Chapter 8. Min H. Kim KAIST School of Computing 18/04/06.

SUMMARY. CS380: Introduction to Computer Graphics Track-/Arc-ball Chapter 8. Min H. Kim KAIST School of Computing 18/04/06. 8/4/6 CS38: Introduction to Computer Graphics Track-/Arc-ball Chapter 8 Min H. Kim KAIST School of Computing Quaternion SUMMARY 2 8/4/6 Unit norm quats. == rotations Squared norm is sum of 4 squares. Any

More information

Quaternion properties: addition. Introduction to quaternions. Quaternion properties: multiplication. Derivation of multiplication

Quaternion properties: addition. Introduction to quaternions. Quaternion properties: multiplication. Derivation of multiplication Introduction to quaternions Definition: A quaternion q consists of a scalar part s, s, and a vector part v ( xyz,,, v 3 : q where, [ s, v q [ s, ( xyz,, q s+ ix + jy + kz i 2 j 2 k 2 1 ij ji k k Quaternion

More information

CT5510: Computer Graphics. Transformation BOCHANG MOON

CT5510: Computer Graphics. Transformation BOCHANG MOON CT5510: Computer Graphics Transformation BOCHANG MOON 2D Translation Transformations such as rotation and scale can be represented using a matrix M.., How about translation? No way to express this using

More information

Representations and Transformations. Objectives

Representations and Transformations. Objectives Repreentation and Tranformation Objective Derive homogeneou coordinate tranformation matrice Introduce tandard tranformation - Rotation - Tranlation - Scaling - Shear Scalar, Point, Vector Three baic element

More information

1 Historical Notes. Kinematics 5: Quaternions

1 Historical Notes. Kinematics 5: Quaternions 1 Historical Notes Quaternions were invented by the Irish mathematician William Rowan Hamilton in the late 1890s. The story goes 1 that Hamilton has pondered the problem of dividing one vector by another

More information

animation computer graphics animation 2009 fabio pellacini 1 animation shape specification as a function of time

animation computer graphics animation 2009 fabio pellacini 1 animation shape specification as a function of time animation computer graphics animation 2009 fabio pellacini 1 animation shape specification as a function of time computer graphics animation 2009 fabio pellacini 2 animation representation many ways to

More information

animation computer graphics animation 2009 fabio pellacini 1

animation computer graphics animation 2009 fabio pellacini 1 animation computer graphics animation 2009 fabio pellacini 1 animation shape specification as a function of time computer graphics animation 2009 fabio pellacini 2 animation representation many ways to

More information

CS230 : Computer Graphics Lecture 12: Introduction to Animation. Tamar Shinar Computer Science & Engineering UC Riverside

CS230 : Computer Graphics Lecture 12: Introduction to Animation. Tamar Shinar Computer Science & Engineering UC Riverside CS230 : Computer Graphics Lecture 12: Introduction to Animation Tamar Shinar Computer Science & Engineering UC Riverside Types of animation keyframing rotoscoping stop motion procedural simulation motion

More information

Introduction to quaternions. Mathematics. Operations

Introduction to quaternions. Mathematics. Operations Introduction to quaternions Topics: Definition Mathematics Operations Euler Angles (optional) intro to quaternions 1 noel.h.hughes@gmail.com Euler's Theorem y y Angle! rotation follows right hand rule

More information

To graph the point (r, θ), simply go out r units along the initial ray, then rotate through the angle θ. The point (1, 5π 6

To graph the point (r, θ), simply go out r units along the initial ray, then rotate through the angle θ. The point (1, 5π 6 Polar Coordinates Any point in the plane can be described by the Cartesian coordinates (x, y), where x and y are measured along the corresponding axes. However, this is not the only way to represent points

More information

Working With 3D Rotations. Stan Melax Graphics Software Engineer, Intel

Working With 3D Rotations. Stan Melax Graphics Software Engineer, Intel Working With 3D Rotations Stan Melax Graphics Software Engineer, Intel Human Brain is wired for Spatial Computation Which shape is the same: a) b) c) I don t need to ask for directions Translations A childhood

More information

Coordinate Transformations. Coordinate Transformation. Problem in animation. Coordinate Transformation. Rendering Pipeline $ = $! $ ! $!

Coordinate Transformations. Coordinate Transformation. Problem in animation. Coordinate Transformation. Rendering Pipeline $ = $! $ ! $! Rendering Pipeline Another look at rotation Photography: real scene camera (captures light) photo processing Photographic print processing Computer Graphics: 3D models camera tone model reproduction (focuses

More information

CS 130 Final. Fall 2015

CS 130 Final. Fall 2015 CS 130 Final Fall 2015 Name Student ID Signature You may not ask any questions during the test. If you believe that there is something wrong with a question, write down what you think the question is trying

More information