Vous êtes sur la page 1sur 8

Overview

• Kinematics
" Considers only motion
" Determined by positions, velocities, accelerations

Kinematics & Dynamics • Dynamics


" Considers underlying forces
" Compute motion from initial conditions and physics
Adam Finkelstein
Princeton University
COS 426, Spring 2005

Example: 2-Link Structure Forward Kinematics


• Two links connected by rotational joints • Animator specifies joint angles: !1 and !2
• Computer finds positions of end-effector: X
!2
“End-Effector”
l2 !2
l2
l1 X = (x,y)
l1 X = (x,y)
!1 !1
(0,0) (0,0)

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

Forward Kinematics Forward Kinematics


• Joint motions can be specified by spline curves • Joint motions can be specified by initial conditions
and velocities
!2
l2 !2
l2
l1 X = (x,y)
l1 X = (x,y)
!1
!1
(0,0) !1
(0,0) "1 (0) = 60o " 2 (0) = 250o

d"1 d" 2
!2 = 1.2 = !0.1
t dt dt
Example: 2-Link Structure Inverse Kinematics
• What if animator knows position of “end-effector” • Animator specifies end-effector positions: X
• Computer finds joint angles: !1 and !2:
!2
“End-Effector”
!2
l2
l2
X = (x,y) X = (x,y)
l1
l1 & x 2 + x 2 ' l12 ' l2 2 #
!1 !1 ( 2 = cos '1 $$ !
!
% 2l1l2 "
(0,0) (0,0)
" (l2 sin(! 2 ) x + (l1 + l2 cos(! 2 )) y
!1 =
(l2 sin(! 2 )) y + (l1 + l2 cos(! 2 )) x

Inverse Kinematics Inverse Kinematics


• End-effector postions specified by spline curves • Problem for more complex structures
" System of equations is usually under-defined
!2 " Multiple solutions
l2 X = (x,y)
!2
l1 X = (x,y) l3
l2
!1
!3
(0,0)
x l1
!1
y Three unknowns: !1, !2 , !3
t (0,0)
Two equations: x, y

Inverse Kinematics Inverse Kinematics


• Solution for more complex structures: • Style-based IK: optimize for learned style
" Find best solution (e.g., minimize energy in motion)
" Non-linear optimization

X = (x,y)
!2
l3
l2
!3
l1
!1
(0,0)
Growchow 04
Summary of Kinematics Overview
• Forward kinematics • Kinematics
" Specify conditions (joint angles) " Considers only motion
" Compute positions of end-effectors " Determined by positions, velocities, accelerations

• Inverse kinematics • Dynamics


" “Goal-directed” motion " Considers underlying forces
" Specify goal positions of end effectors " Compute motion from initial conditions and physics
" Compute conditions required to achieve goals " Active dynamics: objects have muscles or motors
" Passive dynamics: external forces only
Inverse kinematics provides easier
specification for many animation tasks,
but it is computationally more difficult

Dynamics Spacetime Constraints


• Simulation of physics insures realism of motion • Animator specifies constraints:
" What the character’s physical structure is
» e.g., articulated figure
" What the character has to do
» e.g., jump from here to there within time t
" What other physical structures are present
» e.g., floor to push off and land
" 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
xi ! xi !1
• Example: particle with jet propulsion x'i =
h
" x(t) is position of particle at time t x ! 2 xi + xi !1
x' 'i = i +1
" f(t) is force of jet propulsion at time t h2
" Particle’s equation of motion is:
mx' '! f ! mg = 0 ' x ! 2 xi + xi !1 $
m% x' 'i = i +1 " ! f i ! mg = 0
& h2 #
" Suppose we want to move from a to b within t0 to t1
with minimum jet fuel:
t1
2
Minimize ! f (t ) 2 dt subject to x(t0)=a and x(t1)=b Minimize h ! f i subject to x0=a and x1=b
i
t0 Witkin & Kass `88 Witkin & Kass `88
Spacetime Constraints Spacetime Constraints
• Solve with • Advantages:
iterative " Free animator from having to specify details of
optimization physically realistic motion with spline curves
methods " Easy to vary motions due to new parameters
and/or new constraints

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

Witkin & Kass `88

Spacetime Constraints Spacetime Constraints


• Adapting motion: • Adapting motion:

Original Jump

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

Spacetime Constraints Motion Sketching


• Adapting motion: • Plausible motion matches sketched constraints

Ski Jump
Popovic 03
Witkin & Kass `88
Spacetime Constraints Passive Dynamics
• Advantages: • Other physical simulations:
" Free animator from having to specify details of " Rigid bodies
physically realistic motion with spline curves " Soft bodies
" Easy to vary motions due to new parameters " Cloth
and/or new constraints " Liquids
" Gases
• Challenges: " etc.
Cloth
" Specifying constraints and objective functions (Baraff & Witkin `98)
" Avoiding local minima during optimization

Hot Gases
(Foster & Metaxas `97)

Particle Systems Particle Systems


• A particle is a point mass • For each frame:
" Mass " Create new particles and assign attributes
" Position v " Delete any expired particles
" Velocity " Update particles based on attributes and physics
" Acceleration " Render particles
" Color p = (x,y,z)
" Lifetime

• Use lots of particles to model complex phenomena


" Keep array of particles

Creating/Deleting Particles Example: Wrath of Khan


• Where to create particles? This is where user
" Around some center controls animation
" Along some path
" Surface of shape
" Where particle density is low

• When to delete particles?


" Where particle density is high
" Life span
" Random

Reeves
Example: Wrath of Khan Example: Wrath of Khan

Reeves Reeves

Equations of Motion Solving the Equations of Motion


• Newton’s Law for a point mass • Initial value problem
" f = ma " Know p(0), v(0), a(0)
" Can compute force at any time and position
" Compute p(t) by forward integration
• Update every particle for each time step
" a(t+#t) = g
" v(t+#t) = v(t) + a(t)*#t p(t)
" p(t+#t) = p(t) + v(t)*#t + a(t)2*#t/2 p(0)
f

Hodgins

Solving the Equations of Motion Solving the Equations of Motion


• Euler integration • Euler integration
" p(t+#t)=p(t) + #t f(x,t) " p(t+#t)=p(t) + #t f(x,t)

• Problem:
" Accuracy decreases as #t gets bigger

Hodgins Hodgins
Solving the Equations of Motion Solving the Equations of Motion
• Midpoint method (2nd order Runge-Kutta) • Adapting step size
" Compute an Euler step " Compute pa by taking one step of size h
" Evalute f at the midpoint " Compute pb by taking 2 steps of size h/2
" Take an Euler step using midpoint force " Error = | pa - pb |
» p(t+#t)=p(t) + #t f( p(t) + 0.5*#t f(t),t) " Adjust step size by factor (epsilon/error)1/f
pb
error
pa

Hodgins

Particle System Forces Rendering Particles


• Force fields • Volumes
" Gravity, wind, pressure " Ray casting, etc.

• Viscosity/damping • Points
" Liquids, drag " Render as individual points

• Collisions • Line segments


" Environment " Motion blur over time
" Other particles

• Other particles
" Springs between neighboring particles (mesh)
" Useful for cloth

Example: Fountain More Passive Dynamics Examples


• Spring meshes
• Level sets
• Collisions
• etc.

Particle System API


Example: Cloth Example: Smoke

Fedkiw Fedkiw

Example: Water Example: Water

Fedkiw Fedkiw

Example: Rigid Body Contact Summary


• Kinematics
" Forward kinematics
» Animator specifies joints (hard)
» Compute end-effectors (easy - assn 4!)
" Inverse kinematics
» Animator specifies end-effectors (easier)
» Solve for joints (harder)

• Dynamics
" Space-time constraints
» Animator specifies structures & constraints (easiest)
» Solve for motion (hardest)
" Also other physical simulations
Fedkiw

Vous aimerez peut-être aussi