computer animation algorithms and techniques
DESCRIPTION
Computer Animation Algorithms and Techniques. Technical Background. Spaces and Transformations. Left-handed v. right handed Homogeneous coordinates: 4x4 transformation matrix (TM) Concatenating TMs Basic transformations (TMs) Display pipeline. Display Pipeline. Object Space Data. - PowerPoint PPT PresentationTRANSCRIPT
Computer AnimationRick Parent
Computer AnimationAlgorithms and Techniques
Technical Background
Computer AnimationRick Parent
Spaces and Transformations
Left-handed v. right handedHomogeneous coordinates: 4x4 transformation matrix (TM) Concatenating TMsBasic transformations (TMs)Display pipeline
1zyx
Computer AnimationRick Parent
Display Pipeline
Object Space Data
World Space Data
Eye Space Data
Image Space Data
Display Space Data
Object space to world space (TM)
World space to eye space (TM)
Perspective (TM)ClippingPerspective Divide
Image space to display space (TM)
Computer AnimationRick Parent
Representing an orientation
Example: fixed angles - rotate around global axes
X
Y
Z
Orientation:
PRRRP xyz )()()('
Computer AnimationRick Parent
Working with fixed angles and Rotation Matrices (RMs)
Extracing fixed angles from an orientation
Extracing fixed angles from a RM
Making a RM from fixed angles
Orthonormalizing a RM
Making a RM from transformed unit coordinate system (TUCS)
X
Y
Z
X
YZ
Computer AnimationRick Parent
Transformations in pipeline
object -> world: often rigid transformsworld -> eye: rigid transformsperspective matrix: uses 4th component of homo. coordsperspective divideimage -> screen: 2D map to screen coordinatesClipping: procedure that considers view frustum
Computer AnimationRick Parent
Error considerations
Accumulated round-off error - transform data:transform world data by delta RMupdate RM by delta RM; apply to object dataupdate angle; form RM; apply to object data
orthonormalizationrotation matrix: orthogonal, unit-length columnsiterate update by taking cross product of 2 vectorsscale to unit length
considerations of scalemiles-to-inches can exeed single precision arithmetic
Computer AnimationRick Parent
Orientation Representation
Rotation matrixFixed angles: rotate about global coordinate systemEuler angles: rotate about local coordinate systemAxis-angle: arbitrary axis and angleQuaternions: mathematically handy axis-angle 4-tupleExponential map: 3-tuple version of quaternions
Computer AnimationRick Parent
Transformation Matrix
ponm
lkji
hgfe
dcba
Computer AnimationRick Parent
Transformation Matrix
1000z
y
x
tkji
tgfe
tcba
Computer AnimationRick Parent
Rotation Matrices
1000
0100
00cossin
00sincos
1000
0cos0sin
0010
0sin0cos
1000
0cossin0
0sincos0
0001
Computer AnimationRick Parent
Fixed Angles
Fixed order: e.g., x, y, z; also could be x, y, xGlobal axes
X
Y
Z
PRRRP xyz )()()('
Computer AnimationRick Parent
Gimbal Lock
0900
X
Y
Z
Fixed angle: e.g., x, y, z
000
X
Y
Z
Computer AnimationRick Parent
Gimbal Lock
0900Fixed order of rotations: x, y, z
X
Y
Z
0900
What do these epsilon rotations do?
0900
0900
Computer AnimationRick Parent
Gimbal Lock
0900
X
Y
Z
90090
X
Y
Z
Interpolating FA representations does not produce intuitive rotation because of gimbal lock
Computer AnimationRick Parent
Euler Angles
Prescribed order: e.g., x, y, z or x, y, xRotate around (rotated) local axes
X
Y
Z
Note: fixed angles are same as Euler angles in reverse order and vice versa
PRRRP zyx )()()('
Computer AnimationRick Parent
Axis-Angle
zyx
A
Rotate about given axisEuler’s Rotation TheoremOpenGLFairly easy to interpolate between orientationsDifficult to concatenate rotations
X
Y
Z
A Q
Computer AnimationRick Parent
Axis-angle to rotation matrix
X
Y
Z
A Q Concantenate the following:Rotate A around z to x-z planeRotate A’ around y to x-axisRotate theta around xUndo rotation around y-axisUndo rotation around z-axis
Computer AnimationRick Parent
Axis-angle to rotation matrix
*
)(
*
)sin()ˆ)(cos(ˆ
0
0
0
ˆ
AAIARot
aa
aa
aa
A
azaaaaa
aaaaaa
aaaaaa
A
zyx
xy
xz
yz
zyzxz
zyyyxy
zxyxxx
X
Y
Z
AQ
P
P’
Computer AnimationRick Parent
Quaternion
ARot A *)
2sin(
2cos
Same as axis-angle, but different formStill rotate about given axisMathematically convenient form
X
Y
Z
vs
q
Note: in this form v is a scaled version of the given axis of rotation, A
A Q
Computer AnimationRick Parent
Quaternion Arithmetic
Addition
Multiplication
Length
Inner Product
22112121 vsvsvvss
212112212121 vvvsvsvvssqq
212121 vvssqq
qqq
Computer AnimationRick Parent
Quaternion Arithmetic
Inverse vsqq
2
11
000111 qqqq
111 pqpq
Unit quaternionq
qq ˆ
Computer AnimationRick Parent
Quaternion Represention
Vector
Transform
v0
1)(' qvqvRotv q
Computer AnimationRick Parent
Quaternion Geometric Operations
)())(( vRotvRotRotv qppq
)()( vRotvRot qq
vqqvqqvRotRotv qq
)())(( 111
)()( vRotvRot kqq
Computer AnimationRick Parent
Unit Quaternion Conversions
22
22
22
2212222
2222122
2222221
yxsxyzsyxz
sxyzzxszxy
syxzszxyzy
Rot zyxs
vvzyx
s
/),,(
)(cos2 1
Axis-Angle
Computer AnimationRick Parent
Quaternions
Avoid gimbal lock
Easy to rotate a point
Easy to convert to a rotation matrix
Easy to concatenate – quaternion multiply
Easy to interpolate – interpolate 4-tuples
How about smoothly (in both space and time) interpolate?