Advertisement

Computer

Adam Finkelstein Princeton University COS 426, Spring 2003

Computer Animation 3-D and 2-D animation • What is animation? o Make objects change over time according to scripted actions

• What is simulation? Pixar o Predict how objects change over time according to physical laws

Homer 3-D Homer 2-D University of Illinois

Outline Principles of • Principles of animation • Squash and stretch • Keyframe animation • Slow In and out • Anticipation • Articulated figures • Exaggeration • • Follow through and overlapping action • Timing •Dynamics • Staging • Straight ahead action and pose-to-pose action •Arcs • Secondary action • Appeal Angel Plate 1 Disney

1 Principles of Traditional Animation Principles of Traditional Animation • Squash and stretch • Slow In and Out

Lasseter `87 Watt Figure 13.5

Principles of Traditional Animation Principles of Traditional Animation • Anticipation (and squash & stretch) • Squash and stretch • Slow In and out • Anticipation • Exaggeration • Follow through and overlapping action • Timing • Staging • Straight ahead action and pose-to-pose action •Arcs • Secondary action • Appeal Lasseter `87 Disney

Computer Animation Keyframe Animation Animation pipeline • Define character poses at specific time steps o 3D modeling called “keyframes” o Articulation o Motion specification o Motion simulation o Shading o Lighting o Rendering o Postprocessing » Compositing

Pixar Lasseter `87

2 Keyframe Animation Keyframe Animation • Interpolate variables describing keyframes to • : determine poses for character “in-between” o Linear interpolation - usually not enough continuity

Linear interpolation

Lasseter `87 H&B Figure 16.16

Keyframe Animation Keyframe Animation • Inbetweening: • Inbetweening: o Spline interpolation - maybe good enough o Cubic spline interpolation - maybe good enough » May not follow physical laws

H&B Figure 16.11 Lasseter `87

Keyframe Animation Keyframe Animation • Inbetweening: • Inbetweening: o Cubic spline interpolation - maybe good enough o or dynamics » May not follow physical laws

Lasseter `87 Rose et al. `96

3 Outline Articulated Figures • Principles of animation • Character poses described by set of rigid bodies connected by “joints” • Keyframe animation

• Articulated figures Base • Kinematics • Dynamics Arm

Hand

Scene Graph

Angel Plate 1 Angel Figures 8.8 & 8.9

Articulated Figures Articulated Figures • Well-suited for humanoid characters Joints provide handles for moving articulated figure

Root

Chest LHip RHip

Neck LCollar LCollar LKnee RKnee

Head LShld LShld LAnkle RAnkle

LElbow LElbow

LWrist LWrist

Rose et al. `96 Mike Marr, COS 426, Princeton University, 1995

Articulated Figures Example: Walk Cycle • Inbetweening • Articulated figure: o Compute joint angles between keyframes

Good arm Bad arm Watt & Watt Watt & Watt

4 Example: Walk Cycle Example: Walk Cycle • Hip joint orientation: • Knee joint orientation:

Watt & Watt Watt & Watt

Example: Walk Cycle Example: Run Cycle • Ankle joint orientation:

Watt & Watt Mike Marr, COS 426, Princeton University, 1995

Example: Ice Skating Outline • Principles of animation • Keyframe animation • Articulated figures • Kinematics • Dynamics

(Mao Chen, Zaijin Guan, Zhiyan Liu, Xiaohu Qie, CS426, Fall98, Princeton University) Angel Plate 1

5 Kinematics and Dynamics Example: 2-Link Structure • Kinematics • Two links connected by rotational joints o Considers only motion o Determined by positions, velocities, accelerations Θ •Dynamics 2 “End-Effector” o Considers underlying forces 2 o Compute motion from initial conditions and physics 1 X = (x,y)

Θ1 (0,0)

Forward Kinematics

specifies joint angles: Θ1 and Θ2 • Joint motions can be specified by spline curves • Computer finds positions of end-effector: X Θ2 2 Θ2 2 X = (x,y) 1

X = (x,y) Θ1 1 (0,0) Θ Θ1 1 (0,0)

Θ2 t X = (l1 cosΘ1 + l2 cos(Θ1 + Θ2 ),l1 sin Θ1 + l2 sin(Θ1 + Θ2 ))

Forward Kinematics Example: 2-Link Structure • Joint motions can be specified by initial conditions • What if animator knows position of “end-effector” and velocities

Θ2 Θ2 “End-Effector” 2 2 X = (x,y) X = (x,y) 1 1

Θ1 o o Θ1 (0,0) Θ1(0) = 60 Θ2 (0) = 250 (0,0) dΘ dΘ 1 =1.2 2 = −0.1 dt dt

6 Inverse Kinematics Inverse Kinematics • Animator specifies end-effector positions: X • End-effector postions can be specified by splines

• Computer finds joint angles: Θ1 and Θ2: Θ2 2 Θ2 2 X = (x,y) X = (x,y) 1 Θ 1  x2 + x2 − l 2 − l 2  1 −1 1 2 (0,0) Θ2 = cos   Θ1   x  2l1l2  (0,0) − (l sin(Θ )x + (l + l cos(Θ ))y 2 2 1 2 2 y Θ1 = t (l2 sin(Θ2 ))y + (l1 + l2 cos(Θ2 ))x

Inverse Kinematics Inverse Kinematics • Problem for more complex structures • Solution for more complex structures: o System of equations is usually under-defined o Find best solution (e.g., minimize energy in motion) o Multiple solutions o Non-linear optimization

X = (x,y) X = (x,y) Θ2 Θ2 3 3 2 2

Θ3 Θ3 1 1

Θ1 Θ1 Three unknowns: Θ , Θ , Θ (0,0) 1 2 3 Two equations: x, y (0,0)

Summary of Kinematics Overview • Forward kinematics • Kinematics o Specify conditions (joint angles) o Considers only motion o Compute positions of end-effectors o Determined by positions, velocities, accelerations • Inverse kinematics •Dynamics o “Goal-directed” motion o Considers underlying forces o Specify goal positions of end effectors o Compute motion from initial conditions and physics o Compute conditions required to achieve goals

InverseInverse kinematicskinematics providesprovides easiereasier specificationspecification forfor manymany animationanimation tasks,tasks, but it is computationally more difficult

7 Dynamics Spacetime Constraints • Simulation of physics insures realism of motion • Animator specifies constraints: o What the character’s physical structure is » e.g., articulated figure o What the character has to do » e.g., jump from here to there within time t o What other physical structures are present » e.g., floor to push off and land o How the motion should be performed » e.g., minimize energy

Lasseter `87

Spacetime Constraints Spacetime Constraints • Computer finds the “best” physical motion • Discretize time steps: satisfying constraints x − x x' = i i−1 • Example: particle with jet propulsion i h o x(t) is position of particle at time t xi+1 − 2xi + xi−1 x''i = o f(t) is force of jet propulsion at time t h2 o Particle’s equation of motion is:

mx''− f − mg = 0  xi+1 − 2xi + xi−1  m x''i =  − fi − mg = 0  h2  o Suppose we want to move from a to b within t0 to t1 with minimum jet fuel: t 1 2 2 Minimizef (t) dt subject to x(t0)=a and x(t1)=b Minimizeh∑ fi subject to x0=a and x1=b ∫ i t0 Witkin & Kass `88 Witkin & Kass `88

Spacetime Constraints Spacetime Constraints • Solve with • Advantages: iterative o Free animator from having to specify details of optimization physically realistic motion with spline curves methods o Easy to vary motions due to new parameters and/or new constraints

• Challenges: o Specifying constraints and objective functions o Avoiding local minima during optimization

Witkin & Kass `88

8 Spacetime Constraints Spacetime Constraints • Adapting motion: • Adapting motion:

Original Jump

Hurdle Heavier Base Witkin & Kass `88 Witkin & Kass `88

Spacetime Constraints Spacetime Constraints • Adapting motion: • Editing motion:

Ski Jump

Witkin & Kass `88 Li et al. `99

Spacetime Constraints Dynamics • Morphing motion: • Other physical simulations: o Rigid bodies o Soft bodies o Cloth o Liquids o Gases o etc. Cloth (Baraff & Witkin `98)

Hot Gases Gleicher `98 (Foster & Metaxas `97)

9 Summary • Principles of animation • Keyframe animation • Articulated figures • Kinematics o Forward kinematics o Inverse kinematics •Dynamics o Space-time constraints o Also other physical simulations

10