Spacetime Constraints Andrew Witkin Michael Kass Presenter: Fayun Luo

Preview:

Citation preview

Spacetime Constraints

Andrew WitkinMichael Kass

Presenter: Fayun Luo

Outline

• Introduction and Motivation

• A Particle Example

• SQP Method

• Extension to Complex Models

• Discussion

• A Tiny Movie Demo

Early Computer Simulations

Question: can we generate those motion automatically?

The first computer generated simulation—Pixar’s Luxo, Jr. 1986

Yes, by adding physics in the simulation.

Physically-based Approaches

Solving Initial Value Problems

V0

x0 x1

Physically-based ApproachesConstraints force methods

A man executing a kickA man executing a kick

The same kick on a frictionless floor

Physically-based Approaches

Spacetime Constraints

Basic idea is solve for the character’s motion and varying force over the entire time.

Newtonian physics

Object Function

Roadmap

• Introduction and MotivationIntroduction and Motivation

• A Particle Example

• SQP MethodSQP Method

• Extension to Complex ModelsExtension to Complex Models

• DiscussionDiscussion

• A Tiny Movie DemoA Tiny Movie Demo

Problem Statement

0 mgfxm

dttfRT

0

2|)(|

bTxax )(,)0(

Governing Equation (Motion Equation):

Object Function (Energy Consumption):

Boundary Conditions:

gf(t)

Discretize continuous function

1n

i

Discretize unknown function x(t) and f(t) as:

x1, x2, …xi, … xn-1, xn

f1, f2, …fi, … fn-1, fn

Our goal is to solve these discretized 2n values.

Next step is to dicretize our motion equation and object equation.

Difference Formula

h

xx

h

xx

h

xxx iiiiiii 2

1111

xi - 1 xi xi + 1

xi - 0.5 xi + 0.5

h h

211

11

5.05.0 2

h

xxx

hh

xx

h

xx

h

xxx iii

iiii

iii

Backward Forward Middle

Middle

Discretized Function

3,2,0)2(

0

112

imgfxxxh

m

mgfxm

iiii

bxbTx

axax

4

1

)(

)0(

t

x

x1, f1

x2, f2

x3, f3x4, f4

Motion equation:

Boundary Conditions:

24

1

0

2

||

|)(|

ii

T

fR

dttfR

Object Function: When does R have minimum value?

0000

0

4321

f

R

f

R

f

R

f

R

f

R

i

Roadmap

• Introduction and MotivationIntroduction and Motivation

• A Particle ExampleA Particle Example

• SQP Method

• Extension to Complex ModelsExtension to Complex Models

• DiscussionDiscussion

• A Tiny Movie DemoA Tiny Movie Demo

Generalize Our Notation

0S

R

3,2,0)2( 112 imgfxxx

h

miiii

bxax 41

t

x

x1, f1

x2, f2

x3, f3

x4, f4

Unknown vector:

S = (S1, S2, …Sn)

Constraint Functions:

Ci(S) = 0

Object Function R(S):

0000

0000

4321

4321

f

R

f

R

f

R

f

R

x

R

x

R

x

R

x

R S = (x1, x2, x3, x4, f1, f2, f3, f4)

j

iij S

CJ

jiij SS

RH

2

SQP Step One

S

R

0S

R

))(())((!2

1))(()()( 22''' axOaxafaxafafxf

Pick a guess S0, evaluate

Taylor series expansion of function f(x) at point a is:

))(()( 2002

2

00

SSOSSS

R

S

R

S

R

SSSS

'100

00 ))((0

SSSSorSSS

SSSHS

Rij

SS

Most likely

Similarly, we have:

= 0 Omit

SQP Step Two

))(()()()( 2'1

'1

'1

'1

SSOSSS

CSCSC

SS

SSSSSSorSSS

SSSJSC ij

0'1

'1

'1

'1

'1 ))(()(

Now we got S1’, evaluate our constraints Ci(S1

’), if equal to 0, we are done but most likely it will not evaluate to 0 in the first several steps.

So, let’s say Ci(S1’) ≠ 0, let’s apply Taylor series expansion on

the constraint function Ci(S) at point S1’ :

1001 SSsoSSSS

Then we will continue with step one and step two until we got a solution Sn which minimize our object function and also satisfy our constraints.

= 0 Omit

S0 S1’ S1 S2

’ S2 … Sn

Graphical Explanation of SQP

S0 S1’

S1S2’ S2

C(S)S

R

S

Roadmap

• Introduction and MotivationIntroduction and Motivation

• A Particle ExampleA Particle Example

• SQP MethodSQP Method

• Extension to Complex Models

• DiscussionDiscussion

• A Tiny Movie DemoA Tiny Movie Demo

Difficulties

• Set up the motion equations

• Define the objective equation

• Evaluate the derivatives

• Fit them into our SQP solver

Derive Motion EquationUse Lagrangian Dynamics to derive our motion equations dynamically:

0)(

Qq

T

q

T

dt

d

T – Kinetic Energy

q – Generalized Coordinates

Q – Generalized Forces

The Authors’ Automatic System

Graphical User Interface

Function Boxes Dynamic System

SQP Solver

T, Q, q J

R H

Roadmap

• Introduction and MotivationIntroduction and Motivation

• A Particle ExampleA Particle Example

• SQP MethodSQP Method

• Extension to Complex ModelsExtension to Complex Models

• Discussion

• A Tiny Movie DemoA Tiny Movie Demo

Lagrangian Dynamics

0)(

Qq

T

q

T

dt

d

Define T for complex system is still too much work.

Define Objective Functions

• Walking on hot coals

• Walking on eggs

• Carrying a bowl of hot soup

• Pursued by a bear

Define appropriate objective functions may be extremely difficult:

The Author’s Automatic System

Symbolic Analysis is really complex, especially for complex system.

The state of art symbolic analysis tool is Matlab, Maple.

The author’s automatic system may work for some relative simple system.

Local Optimization vs Global Optimization

S

R

S0 S* S*

Roadmap

• Introduction and MotivationIntroduction and Motivation

• A Particle ExampleA Particle Example

• SQP MethodSQP Method

• Extension to Complex ModelsExtension to Complex Models

• DiscussionDiscussion

• A Tiny Movie Demo

References

• Pixar, Luxo, Jr. 1986• Ronen Barzel, et al. Dynamic Constraints.

Siggraph 1987• Paul Issacs and Michael Cohen, Controlling

Dynamic Simulation with Kinematic Constraints, Proc. Siggraph 1987

• David C. Brogan, et al. Spacetime Constraints for Biomechanical Movements. Applied Modeling and Simulation, 2002

• Phillip Gill, et al. Practical Optimization, Academic Press, New York, NY, 1981

Recommended