38
Lecture 13 6.837 Fall 2002 Computer Animation Animation Methods Keyframing Interpolation Kinematics Inverse Kinematics Slides courtesy of Leonard McMillan and Jovan Popovic

Research | MIT CSAIL - Computer Animationgroups.csail.mit.edu/graphics/classes/6.837/F02/lectures/29oct2002.… · Lecture 14 Slide 16 6.837 Fall 2002 Second-Order Differential Equations

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Research | MIT CSAIL - Computer Animationgroups.csail.mit.edu/graphics/classes/6.837/F02/lectures/29oct2002.… · Lecture 14 Slide 16 6.837 Fall 2002 Second-Order Differential Equations

Lecture 13 6.837 Fall 2002

Computer Animation

Animation MethodsKeyframingInterpolationKinematicsInverse Kinematics

Slides courtesy of Leonard McMillan and Jovan Popovic

Page 2: Research | MIT CSAIL - Computer Animationgroups.csail.mit.edu/graphics/classes/6.837/F02/lectures/29oct2002.… · Lecture 14 Slide 16 6.837 Fall 2002 Second-Order Differential Equations

Lecture 14 Slide 2 6.837 Fall 2002

AdministrativeOffice hours

Durand & Teller by appointmentNgan Thursday 4-7 in W20-575

Deadline for proposal: Friday Nov 1Meeting with faculty & staff about proposal

Next weekWeb page for appointment

Page 3: Research | MIT CSAIL - Computer Animationgroups.csail.mit.edu/graphics/classes/6.837/F02/lectures/29oct2002.… · Lecture 14 Slide 16 6.837 Fall 2002 Second-Order Differential Equations

Lecture 14 Slide 3 6.837 Fall 2002

Animation4 approaches to animationPros ? Cons ?

Page 4: Research | MIT CSAIL - Computer Animationgroups.csail.mit.edu/graphics/classes/6.837/F02/lectures/29oct2002.… · Lecture 14 Slide 16 6.837 Fall 2002 Second-Order Differential Equations

Lecture 14 Slide 4 6.837 Fall 2002

Computer-Assisted AnimationKeyframing

automate the inbetweeninggood controlless tediouscreating a good animation

still requires considerable skilland talent

Procedural animationdescribes the motion algorithmicallyexpress animation as a function

of small number of parameteresExample: a clock with second, minute and hour hands

hands should rotate togetherexpress the clock motions in terms of a “seconds” variablethe clock is animated by varying the seconds parameter

Example 2: A bouncing ballAbs(sin(ωt+θ0))*e-kt

ACM © 1987 “Principles of traditional animation applied to 3D computer animation”

Page 5: Research | MIT CSAIL - Computer Animationgroups.csail.mit.edu/graphics/classes/6.837/F02/lectures/29oct2002.… · Lecture 14 Slide 16 6.837 Fall 2002 Second-Order Differential Equations

Lecture 14 Slide 5 6.837 Fall 2002

Computer-Assisted AnimationPhysically Based Animation

Assign physical properties to objects (masses, forces, inertial properties)

Simulate physics by solving equationsRealistic but difficult to control

Motion CaptureCaptures style, subtle nuances and realismYou must observe someone do something

ACM© 1988 “Spacetime Constraints”

Page 6: Research | MIT CSAIL - Computer Animationgroups.csail.mit.edu/graphics/classes/6.837/F02/lectures/29oct2002.… · Lecture 14 Slide 16 6.837 Fall 2002 Second-Order Differential Equations

Lecture 14 Slide 6 6.837 Fall 2002

OverviewKeyframing and interpolationInterpolation of rotations, quaternionsKimematrics, articulation

Particles

Rigid bodies

Deformable objects, clothes, fluids

( )tx

( )tv

Page 7: Research | MIT CSAIL - Computer Animationgroups.csail.mit.edu/graphics/classes/6.837/F02/lectures/29oct2002.… · Lecture 14 Slide 16 6.837 Fall 2002 Second-Order Differential Equations

Lecture 14 Slide 7 6.837 Fall 2002

Kinematics vs. DynamicsKinematicsDescribes the positions of the body parts as a function of the joint angles.DynamicsDescribes the positions of the body parts as a function of the applied forces.

Page 8: Research | MIT CSAIL - Computer Animationgroups.csail.mit.edu/graphics/classes/6.837/F02/lectures/29oct2002.… · Lecture 14 Slide 16 6.837 Fall 2002 Second-Order Differential Equations

Lecture 14 Slide 8 6.837 Fall 2002

NowDynamics

ACM© 1988 “Spacetime Constraints”

Page 9: Research | MIT CSAIL - Computer Animationgroups.csail.mit.edu/graphics/classes/6.837/F02/lectures/29oct2002.… · Lecture 14 Slide 16 6.837 Fall 2002 Second-Order Differential Equations

Lecture 14 Slide 9 6.837 Fall 2002

ParticleA single particle in 2-D moving in a flow field

Position

Velocity

The flow field function dictatesparticle velocity

1

2

xx

=

x

1

2

,v dv dt

= =

xv v

( )tx

1x

2x

( ),tg x

( ),t=v g x

Page 10: Research | MIT CSAIL - Computer Animationgroups.csail.mit.edu/graphics/classes/6.837/F02/lectures/29oct2002.… · Lecture 14 Slide 16 6.837 Fall 2002 Second-Order Differential Equations

Lecture 14 Slide 10 6.837 Fall 2002

Vector FieldThe flow field g(x,t) is a vector field that defines a vector for any particle position x at any time t.

How would a particle move in this vector field?

1x

2x( ),tg x

Page 11: Research | MIT CSAIL - Computer Animationgroups.csail.mit.edu/graphics/classes/6.837/F02/lectures/29oct2002.… · Lecture 14 Slide 16 6.837 Fall 2002 Second-Order Differential Equations

Lecture 14 Slide 11 6.837 Fall 2002

Differential EquationsThe equation v = g(x, t) is a first order differential equation:

The position of the particle is computed by integrating the differential equation:

For most interesting cases, this integral cannot be computed analytically.

( ),d tdt

=x g x

( ) ( ) ( )0

0 ,t

t

t t t dt= + ∫x x g x

Page 12: Research | MIT CSAIL - Computer Animationgroups.csail.mit.edu/graphics/classes/6.837/F02/lectures/29oct2002.… · Lecture 14 Slide 16 6.837 Fall 2002 Second-Order Differential Equations

Lecture 14 Slide 12 6.837 Fall 2002

Numeric IntegrationInstead we compute the particle’s position by numeric integration: starting at some initial point x(t0) we step along the vector field to compute the position at each subsequent time instant. This type of a problem is called an initial value problem.

( )0tx

1x

2x

( )1tx

( )2tx

Page 13: Research | MIT CSAIL - Computer Animationgroups.csail.mit.edu/graphics/classes/6.837/F02/lectures/29oct2002.… · Lecture 14 Slide 16 6.837 Fall 2002 Second-Order Differential Equations

Lecture 14 Slide 13 6.837 Fall 2002

Euler’s MethodEuler’s method is the simplest solution to an initial value problem. Euler’s method starts from the initial value and takessmall time steps along the flow:

Why does this work?

( ) ( ) ( ),t t t t t+ ∆ = + ∆x x g x

Let’s look at a Taylor series expansion of function x(t):

Disregarding higher-order terms and replacing the first derivative with the flow field function yields the equation for the Euler’s method.

( ) ( )2 2

22d t dt t t tdt dt

∆+ ∆ = + ∆ + +

x xx x L

Page 14: Research | MIT CSAIL - Computer Animationgroups.csail.mit.edu/graphics/classes/6.837/F02/lectures/29oct2002.… · Lecture 14 Slide 16 6.837 Fall 2002 Second-Order Differential Equations

Lecture 14 Slide 14 6.837 Fall 2002

Other MethodsEuler’s method is the simplest numerical method. The error is proportional to . For most cases, the Euler’s method is inaccurate and unstable requiring very small steps.

Other methods:Midpoint (2nd order Runge-Kutta)Higher order Runge-Kutta (4th order, 6th order)AdamsAdaptive Stepsize

2t∆

1x

2x

Page 15: Research | MIT CSAIL - Computer Animationgroups.csail.mit.edu/graphics/classes/6.837/F02/lectures/29oct2002.… · Lecture 14 Slide 16 6.837 Fall 2002 Second-Order Differential Equations

Lecture 14 Slide 15 6.837 Fall 2002

Particle in a Force FieldWhat is a motion of a particle in a force field?The particle moves according to Newton’s Law:

The mass m of a particle describes the particle’s inertial properties: heavier particles are easier to move than lighter particles. In general, the force field f(x, v, t) may depend on the time t and particle’s position x and velocity v.

( )2

2

d mamdt

= =x f f

Page 16: Research | MIT CSAIL - Computer Animationgroups.csail.mit.edu/graphics/classes/6.837/F02/lectures/29oct2002.… · Lecture 14 Slide 16 6.837 Fall 2002 Second-Order Differential Equations

Lecture 14 Slide 16 6.837 Fall 2002

Second-Order Differential EquationsNewton’s Law yields an ordinary differential equation of second order:

A clever trick allows us to reuse the same numeric differentiation solvers for first-order differential equations. If we define a new phase space vector y, which consists of particle’s position x and velocity v, then we can construct a new first-order differential equation whose solution will also solve the second-order differential equation.

( ) ( )2

2

, ,d t tmdt

=x f x v

/,

/ /d dtd

dt d dt m

= = =

x x vyyv v f

Page 17: Research | MIT CSAIL - Computer Animationgroups.csail.mit.edu/graphics/classes/6.837/F02/lectures/29oct2002.… · Lecture 14 Slide 16 6.837 Fall 2002 Second-Order Differential Equations

Lecture 14 Slide 17 6.837 Fall 2002

Particle AnimationAnimateParticles(n, y0, t0, tf){

y = y0

t = t0DrawParticles(n, y)while(t != tf) {

f = ComputeForces(y, t)dydt = AssembleDerivative(y, f){y, t } = ODESolverStep(6n, y, dy/dt)DrawParticles(n, y)

}}

Page 18: Research | MIT CSAIL - Computer Animationgroups.csail.mit.edu/graphics/classes/6.837/F02/lectures/29oct2002.… · Lecture 14 Slide 16 6.837 Fall 2002 Second-Order Differential Equations

Lecture 14 Slide 18 6.837 Fall 2002

Particle Animation [Reeves et al. 1983]

Star Trek, The Wrath of Kahn [Reeves et al. 1983]Start Trek, The Wrath of Kahn

Page 19: Research | MIT CSAIL - Computer Animationgroups.csail.mit.edu/graphics/classes/6.837/F02/lectures/29oct2002.… · Lecture 14 Slide 16 6.837 Fall 2002 Second-Order Differential Equations

Lecture 14 Slide 19 6.837 Fall 2002

Particle Modeling [Reeves et al. 1983]

Page 20: Research | MIT CSAIL - Computer Animationgroups.csail.mit.edu/graphics/classes/6.837/F02/lectures/29oct2002.… · Lecture 14 Slide 16 6.837 Fall 2002 Second-Order Differential Equations

Lecture 14 Slide 20 6.837 Fall 2002

OverviewKeyframing and interpolationInterpolation of rotations, quaternionsKimematrics, articulation

Particles

Rigid bodies

Deformable objects, clothes, fluids

( )tx

( )tv

Page 21: Research | MIT CSAIL - Computer Animationgroups.csail.mit.edu/graphics/classes/6.837/F02/lectures/29oct2002.… · Lecture 14 Slide 16 6.837 Fall 2002 Second-Order Differential Equations

Lecture 14 Slide 21 6.837 Fall 2002

Rigid-Body DynamicsWe could compute the motion of a rigid-body by computing the motion of all constituent particles. However, a rigid body does not deform and position of few of its particles is sufficient to determine the state of the body in a phase space. We’ll start with a special particle located at the body’s center of mass.

( )tx

( )tv ( )

( )

( )?

?

t

tt

=

x

yv

Page 22: Research | MIT CSAIL - Computer Animationgroups.csail.mit.edu/graphics/classes/6.837/F02/lectures/29oct2002.… · Lecture 14 Slide 16 6.837 Fall 2002 Second-Order Differential Equations

Lecture 14 Slide 22 6.837 Fall 2002

Net Force

( )tx

( )tv

( )2 tf

( )3 tf

( )1 tf

( ) ( )ii

t t= ∑f f

Page 23: Research | MIT CSAIL - Computer Animationgroups.csail.mit.edu/graphics/classes/6.837/F02/lectures/29oct2002.… · Lecture 14 Slide 16 6.837 Fall 2002 Second-Order Differential Equations

Lecture 14 Slide 23 6.837 Fall 2002

Net Torque

( )tx

( )tv( )1

b tp

( )3b tp

( )2b tp

( ) ( )( ) ( )bi i

it t t= − ×∑τ p x f

( )2 tf

( )3 tf

( )1 tf

Page 24: Research | MIT CSAIL - Computer Animationgroups.csail.mit.edu/graphics/classes/6.837/F02/lectures/29oct2002.… · Lecture 14 Slide 16 6.837 Fall 2002 Second-Order Differential Equations

Lecture 14 Slide 24 6.837 Fall 2002

Rigid-Body Equation of Motion

( )

( )( )( )

( ) ( )

( )( ) ( )

( )( )

t tt t td dt

M t tdt dtt t t

ω = =

x vR R

yv f

I ω τ

( )( ) ( )

linear momentum

angular momentum

M t

t t

v

I ω

Page 25: Research | MIT CSAIL - Computer Animationgroups.csail.mit.edu/graphics/classes/6.837/F02/lectures/29oct2002.… · Lecture 14 Slide 16 6.837 Fall 2002 Second-Order Differential Equations

Lecture 14 Slide 25 6.837 Fall 2002

Simulations with CollisionsSimulating motions with collisions requires that we detect them (collision detection) and fix them (collision response).

( )0ty

( )1ty

( )2ty

( )3ty

Page 26: Research | MIT CSAIL - Computer Animationgroups.csail.mit.edu/graphics/classes/6.837/F02/lectures/29oct2002.… · Lecture 14 Slide 16 6.837 Fall 2002 Second-Order Differential Equations

Lecture 14 Slide 26 6.837 Fall 2002

Collision ResponseThe mechanics of collisions are complicated and many mathematical models have been developed. We’ll just look at a one simple model, which assumes that when the collision occurs the two bodes exchange collision impulse instantaneously.

nb

pb−v

+ = ?v

Page 27: Research | MIT CSAIL - Computer Animationgroups.csail.mit.edu/graphics/classes/6.837/F02/lectures/29oct2002.… · Lecture 14 Slide 16 6.837 Fall 2002 Second-Order Differential Equations

Lecture 14 Slide 27 6.837 Fall 2002

Frictionless Collision Model

nb

pb−v

ε = 1

ε =12

ε = 0

( )ε+ −⋅ = − ⋅n nb v b v

+v

Page 28: Research | MIT CSAIL - Computer Animationgroups.csail.mit.edu/graphics/classes/6.837/F02/lectures/29oct2002.… · Lecture 14 Slide 16 6.837 Fall 2002 Second-Order Differential Equations

Lecture 14 Slide 28 6.837 Fall 2002

OverviewKeyframing and interpolationInterpolation of rotations, quaternionsKimematrics, articulation

Particles

Rigid bodies

Deformable objects, clothes, fluids

( )tx

( )tv

Page 29: Research | MIT CSAIL - Computer Animationgroups.csail.mit.edu/graphics/classes/6.837/F02/lectures/29oct2002.… · Lecture 14 Slide 16 6.837 Fall 2002 Second-Order Differential Equations

Lecture 14 Slide 29 6.837 Fall 2002

Deformable modelsShape deforms due to contactDiscretize the problemAnimation runs with smaller time steps than rendering (between 1/10,000s and 1/100s)

Images from Debunne et al. 2001

Page 30: Research | MIT CSAIL - Computer Animationgroups.csail.mit.edu/graphics/classes/6.837/F02/lectures/29oct2002.… · Lecture 14 Slide 16 6.837 Fall 2002 Second-Order Differential Equations

Lecture 14 Slide 30 6.837 Fall 2002

Mass-Spring systemNetwork of masses and springsExpress forcesIntegrateDeformation of springs simulates deformation of objects

[Dorsey 1996]

F

Images from Debunne et al. 2001

Page 31: Research | MIT CSAIL - Computer Animationgroups.csail.mit.edu/graphics/classes/6.837/F02/lectures/29oct2002.… · Lecture 14 Slide 16 6.837 Fall 2002 Second-Order Differential Equations

Lecture 14 Slide 31 6.837 Fall 2002

Implicit Finite Elements Discretize the problem Express the interrelationshipSolve a big systemMore principled than mass-spring

Object FiniteElements

Largematricial systemSlide from Debunne et al. 2001

Page 32: Research | MIT CSAIL - Computer Animationgroups.csail.mit.edu/graphics/classes/6.837/F02/lectures/29oct2002.… · Lecture 14 Slide 16 6.837 Fall 2002 Second-Order Differential Equations

Lecture 14 Slide 32 6.837 Fall 2002

Explicit Finite Elements Discretize the problem Solve locallySimpler but less stable than implicit

Object FiniteElements

Independentmatricial systemsSlide from Debunne et al. 2001

Page 33: Research | MIT CSAIL - Computer Animationgroups.csail.mit.edu/graphics/classes/6.837/F02/lectures/29oct2002.… · Lecture 14 Slide 16 6.837 Fall 2002 Second-Order Differential Equations

Lecture 14 Slide 33 6.837 Fall 2002

Formally: Finite Elements We are trying to solve a continuous problem

Deformation of all points of the objectInfinite space of functions

We project to a finite set of basis functionsE.g. piecewise linear, piecewise constant

We project the equations governing the problemThis results in a big linear system

Object FiniteElements

Large matricial system

Page 34: Research | MIT CSAIL - Computer Animationgroups.csail.mit.edu/graphics/classes/6.837/F02/lectures/29oct2002.… · Lecture 14 Slide 16 6.837 Fall 2002 Second-Order Differential Equations

Lecture 14 Slide 34 6.837 Fall 2002

Cloth animationDiscretize cloth Write physical equationsIntegrateCollision detection

Image from Meyer et al. 2001

Page 35: Research | MIT CSAIL - Computer Animationgroups.csail.mit.edu/graphics/classes/6.837/F02/lectures/29oct2002.… · Lecture 14 Slide 16 6.837 Fall 2002 Second-Order Differential Equations

Lecture 14 Slide 35 6.837 Fall 2002

Fluid simulationDiscretize volume of fluid

Exchanges and velocity at voxel boundary

Write Navier Stokes equationsIncompressible, etc.

Numerical integrationFinite elements, finite differences

Challenges:Robust integration, stabilitySpeedRealistic surface

Figure from Fedkiw et al. 2001

Figure from Enright et al. 2002

Page 36: Research | MIT CSAIL - Computer Animationgroups.csail.mit.edu/graphics/classes/6.837/F02/lectures/29oct2002.… · Lecture 14 Slide 16 6.837 Fall 2002 Second-Order Differential Equations

Lecture 14 Slide 36 6.837 Fall 2002

Other physical animationAging of materials

Metallic patina, rustWater flowStone aging

[Dorsey 1996-1999]

Page 37: Research | MIT CSAIL - Computer Animationgroups.csail.mit.edu/graphics/classes/6.837/F02/lectures/29oct2002.… · Lecture 14 Slide 16 6.837 Fall 2002 Second-Order Differential Equations

Lecture 14 Slide 37 6.837 Fall 2002

How do they animate movies?Keyframing mostlyArticulated figures, inverse kinematicsSkinning

Complex deformable skinMuscle, skin motion

Hierarchical controlsSmile control, eye blinking, etc. Keyframes for these higher-level controls

A huge time is spent building the 3D models, its skeleton and its controlsPhysical simulation for secondary motion

Hair, cloths, waterParticle systems for “fuzzy” objects

Images from the Maya tutorial

Page 38: Research | MIT CSAIL - Computer Animationgroups.csail.mit.edu/graphics/classes/6.837/F02/lectures/29oct2002.… · Lecture 14 Slide 16 6.837 Fall 2002 Second-Order Differential Equations

Lecture 14 Slide 38 6.837 Fall 2002

Next time: Texture mapping