Title: 681 - Introduction to Computer Graphics
1Animating with Quaternions
Given quaternion representations, interpolate
through them
Cubic, interpolating
Use operations efficient with quaternion
representation
Halfway between 2 quaternions
Spherical Linear interpolation
2Review of Quaternion Math
(cos(q/2),sin(q/2)A)
s1,v1 s2,v2 s1s2,v1v2
s1,v1 s2,v2 s1s2-v1.v2,s1v2s2v1v1Xv2
q sqrt(ss xx yy zz)
q-1 -s,v/q2
3Rotation Matrix of a Unit Quaternion
w,x,y,z
4Review of Quaternion Rotations
Rotq(v) v q 0,v q-1
Rotq(v) Rotkq(v)
Rotqp(v) Rotq(Rotp(v) )
5Quaternions as points on a 4D sphere
Unit quaternion q(s,x,y,z), q 1
Want equal increment along arc connecting two
quaternions on surface of sphere spherical linear
interpolation
6Linearly interpolate between quaternions
q(sq,xq,yq,zq), p(sp,xp,yp,zp)
7Interpolation
K (1-a) A a B
Scalar
(linear interpolation lerp)
Quaternions?
8Quaternion Power Operator
cos(q/2), sin(q /2) A a
cos(aq/2), sin(aq /2) A
q a rotates to q orientation as a goes from 0 to
1
Remember q and -q represent same orientation q
a and (-q) a give different rotation sequences 0lt
q lt p gives short squence p lt q lt2 p gives long
one Since first term in q is cos(q/2), q gives
short sequence if first term is positive
9Quaternions as points on a 4D sphere
Remember Rots,v Rot-s,-v
Use quaternion representations that are close
to each other
Given quaternion p, should you interpolate to q
or -q?
p and q are close if their 4D dot product is
greater than zero.
10Interpolation of rotations
q slerp(qa,qb, a)
11Review of Bezier Interpolation
Using Catmull-Romm interp of interior control
points
12Bezier Interpolation of Quaternions
13Interpolation Background
De Casteljau construction of Bezier curve
u1/3
P(1/3)
14Interpolation Background
Easy to compute quaternion half-way point
q1/2 q0 q01
15Quaternion - cubic interpolation
16Quaternion Interpolation
Automatically generating interior (spherical)
control points
Q n
P n
A n
P n1
Bisect the span
P n-1
Double the arc
17Quaternion Interpolation
Q n
Double(q1,q2) q2q1-1q2
P n
Q n Double(P n-1, P n)
P n-1
18Construct Midpoint
q1 q2 s1,x1,y1,z1 s2,x2,y2,z2
Bisect(p,q) (pq)/pq
A n Bisect(Q n, P n1)
19Spherical Linear Interpolation
20Repeated mid-point interpolation
For u 1/4
21Quaternion Interpolation
Linearly interpolating between 4 keys
Cubic Bezier interpolation among same 4 keys