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
tedious
Reduce burden with cel animation
layer
keyframe
inbetween
cel panoramas (Disney’s Pinocchio)
...
ACM © 1997 “Multiperspective panoramas for cel
Lecture 21 Slideanimation”
2 6.837 Fall 2001
Computer-Assisted Animation
Keyframing
automate the inbetweening
good control
less tedious
creating a good animation
still requires considerable skill
and talent
ACM © 1987 “Principles of traditional
Procedural animation animation applied to 3D computer
animation”
describes the motion algorithmically
express animation as a function
of small number of parameteres
Example: a clock with second, minute and hour hands
hands should rotate together
express the clock motions in terms of a “seconds” variable
the clock is animated by varying the seconds parameter
Lecture 21 Slide 3 6.837 Fall 2001
Computer-Assisted Animation
Physically Based Animation
Assign physical properties to objects
(masses, forces, inertial properties)
Simulate physics by solving equations
Realistic but difficult to control
ACM© 1988 “Spacetime Constraints”
Motion Capture
Captures style, subtle nuances and realism
You must observe someone do something
Lecture 21 Slide 4 6.837 Fall 2001
Keyframing
ACM © 1987 “Principles of traditional animation
applied to 3D computer animation”
Describe motion of objects as a function of time from a
set of key object positions. In short, compute the
inbetween frames. s(t)
Lecture 21 Slide 5 6.837 Fall 2001
Interpolating Positions
(x i , y i ,t i ), i 0, , n
Given positions:
x (t ) xi
find curveC (t ) C (t i )
such that
y (t ) yi
(x 2 , y 2 ,t 2 )
C (t ) (xu
0 , y 0 ,t 0 )
0
( x1 , y 1 , t 1 )
Lecture 21 Slide 6 6.837 Fall 2001
Linear Interpolation
(x 2 , y 2 ,t 2 )
(x 0 , y 0 ,t 0 )
( x1 , y 1 , t 1 )
Simple problem: linear interpolation between first two
: 0 1 t x1t
t 0=0 and t1=1 x (t ) x
points assuming
The x-coordinate for the complete curve in the figure:
t1 t t t0
t t 0 t t x1 , t t 0 ,t1
x
1 0 1 0
x (t )
t 2 t x t t1 x , t t , t
t 2 t1 1 t 2 t1 2 1 2
Lecture 21 Slide 7 6.837 Fall 2001
Polynomial Interpolation
(x 2 , y 2 ,t 2 )
(x 0 , y 0 ,t 0 )
parabola
( x1 , y 1 , t 1 )
An n-degree polynomial can interpolate any n+1
points. The Lagrange formula gives the n+1
coefficients of an n-degree polynomial that interpolates
n+1 points. The resulting interpolating polynomials are
called Lagrange polynomials. On the previous slide, we
saw the Lagrange formula for n = 1.
Lecture 21 Slide 8 6.837 Fall 2001
Spline Interpolation
Lagrange polynomials of small degree are fine but high
degree polynomials are too wiggly. Spline (piecewise
cubic polynomial) interpolation produces nicer
t
interpolation. t t
x t
8-degree spline spline vs.
polynomial polynomial
How many n-degree polynomials interpolate n+1 points?
How many splines interpolate n+1 points?
Lecture 21 Slide 9 6.837 Fall 2001
Spline Interpolation
A cubic polynomial between each pair of points:
x (t ) c 0 c1t c 2t 2 c 3t 3
Four parameters (degrees of freedom) for each spline
segment.
Number of parameters:
n+1 points n cubic polynomials 4n degrees of freedom
Number of constraints:
interpolation constraints
n+1 points 2 + 2 (n-1) = 2n interpolation constraints
continuous velocity
n+1 points n-1 velocity constraints (one for each interior point)
continuous acceleration
n+1 points n-1 acceleration constraints (one for each interior
point)
Lecture 21 Slide 10 6.837 Fall 2001
Interpolation of Positions
Solve an optimization to set remaining degrees of
max quality C t
freedom: min badness C t
dof dof
subject to constraints subject to constraints
badness C t quality C t
We want to support general constraints: not just
smooth velocity and acceleration. For example, a
bouncing ball does not always have continuous
velocity:
Lecture 21 Slide 11 6.837 Fall 2001
Interpolating Angles
Given angles( i ,t i ), i 0, , n
find curve (t ) such that (t i ) i
Angle interpolation is ambiguous. Different angle
measurements will produce different motion:
1
0
2
2
Lecture 21 Slide 12 6.837 Fall 2001
Keyframing
K i x i , y i , i ,t i , i 0, , n
Given keyframes
x t
K
find curve (t )
y t K (t i ) K i
such that
t
Interpolate each parameter separately
Lecture 21 Slide 13 6.837 Fall 2001
Traditional Animation Principles
The in-betweening, was once a job for apprentice
animators. We described the automatic interpolation
techniques that accomplish these tasks automatically.
However, the animator still has to draw the key frames.
This is an art form and precisely why the experienced
animators were spared the in-betweening work even
before automatic techniques.
The classical paper on animation by John Lasseter from
Pixar surveys some the standard animation techniques:
"Principles of Traditional Animation Applied to 3D
Computer Graphics,“ SIGGRAPH'87, pp. 35-44.
Lecture 21 Slide 14 6.837 Fall 2001
Squash and stretch
Squash: flatten an object or character by pressure or
by its own power
Stretch: used to increase the sense of speed and
emphasize the squash by contrast
Lecture 21 Slide 15 6.837 Fall 2001
Timing
Timing affects weight:
Light object move quickly
Heavier objects move slower
Timing completely changes the interpretation of the
motion. Because the timing is critical, the animators
used the draw a time scale next to the keyframe to
indicate how to generate the in-between frames.
Lecture 21 Slide 16 6.837 Fall 2001
Anticipation
An action breaks down into:
Anticipation
Action
Reaction
Anatomical motivation: a muscle must extend before it
can contract. Prepares audience for action so they
know what to expect. Directs audience’s attention.
Amount of anticipation can affect perception of speed
and weight.
Lecture 21 Slide 17 6.837 Fall 2001
Interpolating Key Frames
Interpolation is not fool proof. The splines may
undershoot and cause interpenetration. The
animator must also keep an eye out for these types
of side-effects.
Lecture 21 Slide 18 6.837 Fall 2001
Interpolating Orientations in 3-D
Rotation matrices
Given rotation matrices Mi and time ti, find M(t) such
that M(ti)=Mi.
y
y x
M x y z
x
z
z
Lecture 21 Slide 19 6.837 Fall 2001
Flawed Solution
Linearly interpolate each entry independently
Example: M0 is identity and M1 is 90-deg rotation
around x-axis
1 0 0 1 0 0 1 0 0
Interpolate ( 0 1 0 , 0 0 1 ) 0 0.5 0.5
0 0 1 0 1 0 0 0.5 0.5
Is the result a rotation matrix?
The result R is not a rotation matrix. For example,
check that RRT does not equal identity. In short, this
interpolation does not preserve the rigidity (angles
and lengths) of the transformation.
Lecture 21 Slide 20 6.837 Fall 2001
Euler Angles
An euler angle is a rotation about a single axis. Any
orientation can be described composing three rotation
around each coordinate axis. We can visualize the
action of the Euler angles: each loop is a rotation
around one coordinate axis.
Lecture 21 Slide 21 6.837 Fall 2001
Interpolating Euler Angles
Natural orientation representation: three angles
for three degrees of freedom
Unnatural interpolation: A rotation of 90-degrees
first around the z-axis and then around the y-axis has
the effect of a 120-degree rotation around the axis (1,
1, 1). But rotation of 30-degrees around the z- and y-
axis does not have the effect of a 40-degree rotation
around the axis (1, 1, 1).
Gimbal lock: two or more axis align resulting
in a loss of rotation degrees of freedom. For
example, if the green loop in previous slide
aligns with the red loop then both the rotation
around the blue loop and the rotation around
the red loop produces identical rotation.
Lecture 21 Slide 22 6.837 Fall 2001
Quaternion Interpolation
Linear interpolation (lerp) of quaternion representation
of orientations gives us something better:
lerp q0 , q1 ,t q(t ) q0 1 t q1t
Quaternion Refresher
a general
quaternion q consistsof four numbers: a scalar s
and av3-D
v1 ,v 2 ,v 3
vector q s ,v :
two general quaternions are multiplied by a special rule:
q1q2 s1s 2 v1 v 2 , s1v 2 s 2v1 v1 v 2
q cos( / 2), sin( / 2)a
a unit quaternion
can represent a rotationof radians around the unit axisa
vector
a
Lecture 21 Slide 23 6.837 Fall 2001
Quaternion Interpolation
The only problem with linear interpolation (lerp) of
quaternions is that it interpolates the straight line (the
secant) between the two quaternions and not their
spherical distance. As a result, the interpolated motion
does not have smooth velocity: it may speed up too
much in some sections: qt qt
q0 q1
keyframes lerp slerp
Spherical linear interpolation (slerp) removes this
problem by interpolating along q0 sin the lines
1 tarc t of
instead
q1 sin
slerp q0lines.
the secant , q1 ,t q(t ) ,
sin
where cos 1 q0 q1
Lecture 21 Slide 24 6.837 Fall 2001
Articulated Models
Articulated models:
rigid parts
connected by joints
They can be animated by specifying the joint angles (or
other display parameters) as functions of time.
qi qi (t )
t1 t2 t1 t2
Lecture 21 Slide 25 6.837 Fall 2001
Forward Kinematics
Describes the positions of the body parts as a function
of the joint angles.
1 DOF: knee 2 DOF: wrist 3 DOF: arm
Lecture 21 Slide 26 6.837 Fall 2001
Skeleton Hierarchy
Each bone transformation described relative to the
parent in the hierarchy:
x h , y h , zh , qh , f h , s h
hips
qt , f t , st ...
left-leg
r-thigh
qc
r-calf
qff , f r-foot
Lecture 21 Slide 27 6.837 Fall 2001
Forward Kinematics
x h , y h , zh , qh , f h , s h
Transformation matrix for a sensor/effecter
vs is a matrix composition of all joint
qt , f t , st
transformation between the sensor/effecter
and the root of the hierarchy.
qc
y
vs
qff , f vs x
z
vw = T(xh, yh, zh )R(qh, f h, s h ) TR(qt , f t , st ) TR(qc ) TR(qff, f ) vs
vw=S xh , y h , zh , h , h , h ,t , t , t ,c ,ff , v s =S pv s
p
Lecture 21 Slide 28 6.837 Fall 2001
Inverse Kinematics
Forward Kinematics
Given the skeleton parameters (position of the root and the
joint angles) p and the position of the sensor/effecter in local
coordinates vs, what is the position of the sensor in the world
coordinates vw.
S p vs
Not too hard, we can solve it by evaluating
Inverse Kinematics
Given the the position of the sensor/effecter in local
coordinates vs and the position of the sensor in the world
coordinates vw, what are the skeleton parameters p.
S p
Much harder requires
solving the inverse of
the non-linear function
p? such that S p v s vw 0
2
minimize S p v s vw
We can solve it by root-finding
p
We can solve it by optimization
Lecture 21 Slide 29 6.837 Fall 2001
Kinematics vs. Dynamics
Kinematics
Describes the positions of the body parts as a function
of the joint angles.
Dynamics
Describes the positions of the body parts as a function
of the applied forces.
Lecture 21 Slide 30 6.837 Fall 2001
Next Time
Dynamics
ACM© 1988 “Spacetime Constraints”
Lecture 21 Slide 31 6.837 Fall 2001