# Controlling Animation

AI and Robotics

Nov 14, 2013 (4 years and 6 months ago)

99 views

Lecture 23

6.837 Fall 2001

Controlling Animation

Boundary
-
Value
Problems

Shooting Methods

Constrained
Optimization

Robot Control

Lecture 23

Slide
2

6.837 Fall 2001

Computer Animation

Story

(concept, storyboard)

Production

(modeling, motion, lighting)

Lecture 23

Slide
3

6.837 Fall 2001

Motion

Keyframing

Interpolates motion from “key” positions

Perfect control

Can be tedious

No realism

Lecture 23

Slide
4

6.837 Fall 2001

F ma
=
Motion

Simulation

Solves equations of motion to compute motion

Realistic motion

Automatic generation

Difficult to control

Lecture 23

Slide
5

6.837 Fall 2001

Controlling Simulation

What initial velocity will cause the hat to land on the coatrack?

Lecture 23

Slide
6

6.837 Fall 2001

Production

Story dictates the motion. Animator’s must control the
behavior.

Lecture 23

Slide
7

6.837 Fall 2001

Simulation Function S(t, u)

S
simulator

( ) (,)
q t S t u
=
( )
q t
u
u
initial
velocity

nonlinear

not continuous

Lecture 23

Slide
8

6.837 Fall 2001

How do we compute S(t, u)?

Solve an initial
-
value problem: numerically integrate the first
-
order differential equation...detect collisions...apply impulses
when collisions occur.

t t
t t t
d d
t
M t t
dt dt
t t t

   
   
   
 
   
   
   
   
x v
R R
q
v f
I
ω τ
Lecture 23

Slide
9

6.837 Fall 2001

Boundary
-
Value Problem

A solution to an initial value problem is a motion that is the
solution to a differential equation with the specified initial
value. A solution to a boundary value must also solve the
ordinary differential equation and match the specified
boundary values (initial, final, or any other).

Lecture 23

Slide
10

6.837 Fall 2001

Boundary
-
Value Problem

What initial velocity will cause the hat to land on the coatrack?

0 0
,
x R
1 1
,
x R
Lecture 23

Slide
11

6.837 Fall 2001

Solution by Shooting

Shooting Method

Pick initial linear and angular velocity
u
= (
v
,
ω
)

Simulate with initial value
q
0
=(
x
0
,
R
0
,
u
) to compute the simulation
function
S
(t,
u
)

Repeat until
S
(t,
u
) matches the other boundary value
x
1
,
R
1

Problem

The initial linear and angular velocity are described by 6 parameters.

Exploring a parameter space of high
-
dimension requires many
samples: number of points in a uniform grid grows exponentially.

n
2
n
3
n
Lecture 23

Slide
12

6.837 Fall 2001

Shooting Method

We can combat the high dimensional parameter spaces with
clever sampling techniques or derivative
-
based methods.

Sampling techniques

Importance Sampling

Markov Chain Monte Carlo

Derivative
-
based Methods

Newton’s root finding method

Human assistance (interaction)

Lecture 23

Slide
13

6.837 Fall 2001

Interactive Control

(,)
S t u
q u
u
d d

=

( ) (,)
q t S t u
=
( )
q t
q
d
u
d
Lecture 23

Slide
14

6.837 Fall 2001

Interactive Control

(,)
S t u
u
Lecture 23

Slide
15

6.837 Fall 2001

Interactive Control

(,)
S t u
q
d
-
q
d
Lecture 23

Slide
16

6.837 Fall 2001

Interactive Control

(,)
S t u
u
update

q
d
u
d
q
d
-
/
S u
¶ ¶
S
u

u
d
1
S
u q
u
d d
-
æ ö

÷
ç
=
÷
ç
÷
ç
è ø

Lecture 23

Slide
17

6.837 Fall 2001

More Parameters

S
simulator

( ) (,)
q t S t u
=
( )
q t
0
3
u
u
u
æ ö
÷
ç
÷
ç
÷
ç
=
÷
ç
÷
ç
÷
ç
÷
÷
ç
è ø
M
0
u
velocity

3
u
gravity

1
u
surface

2
u
Lecture 23

Slide
18

6.837 Fall 2001

More Constraints

S
simulator

u
velocity

gravity

surface

1
q
d
0
q
d
1
0
0
1
1
(,)
(,)
S t u
q
u
u
q
S t u
u
d
d
d
-
æ ö

÷
ç
÷
ç
æ ö
÷
ç

÷
÷
ç
ç
=
÷
÷
ç
ç
÷
÷
÷
ç

ç
è ø
÷
ç
÷
÷
ç
÷
ç
è ø

Lecture 23

Slide
19

6.837 Fall 2001

More Bodies

S
simulator

u
velocity

gravity

surface

0
( )
q t
1
( )
q t
0
1
( )
(,)
( )
q t
S t u
q t
æ ö
÷
ç
=
÷
ç
÷
÷
ç
è ø
Lecture 23

Slide
20

6.837 Fall 2001

Active Characters

What about objects that have self
-
propelling muscles and
forces. How can we compute their motion automatically?

Lecture 23

Slide
21

6.837 Fall 2001

Constrained Optimization

Body, muscle and force degrees of freedom:
q
(t)

Constraints

Pose
C
p

Mechanical
C
m

Dynamics
C
d

Objective Function E(
q
(t))

(
)
(
)
( )
min
subject to ,,
t
p m d
E t
q
q
C C C

p
C

m
F
m
C
F ma
=
Lecture 23

Slide
22

6.837 Fall 2001

Controller Approach

Roboticists address almost identical problems in robot design.
How should we control a robot to make it walk or run? Similar
techniques have been applied for problems in computer
animation.

Biomechanics data and observations

Feedback controllers

designed by hand

simulated annealing

generate
-
and
-
test strategy

parameter estimation and parallel optimization techniques

Lecture 23

Slide
23

6.837 Fall 2001

Next Time

Research in the MIT Computer Graphics Group