13
Integration for physically based animation CSE 3541 Matt Boggus

Integration for physically based animation CSE 3541 Matt Boggus

Embed Size (px)

Citation preview

Page 1: Integration for physically based animation CSE 3541 Matt Boggus

Integration for physically based animation

CSE 3541Matt Boggus

Page 2: Integration for physically based animation CSE 3541 Matt Boggus

What is motion?

Observe an object’s position over timeWe could say y = f(time)

Page 3: Integration for physically based animation CSE 3541 Matt Boggus

Equations of motion – terms

• Position (x,y,z)– Point with respect to the origin

• Velocity (x,y,z)– Speed (vector magnitude)– Direction

• Acceleration (x,y,z)– Rate of change of velocity– Magnitude and direction

r

Page 4: Integration for physically based animation CSE 3541 Matt Boggus

Equations of motion graph examples

• Initial conditions:– p = 0, v = 5

• If we have the function for acceleration, we can integrate it and use initial conditions to solve for the velocity and position functions

acceleration

velocity

position

Page 5: Integration for physically based animation CSE 3541 Matt Boggus

Euler integrationFor arbitrary function f(t) with known derivative

)( itf)( itf

ttftftf iii )()()( 1

Step in the direction of the derivative

)( itf

Page 6: Integration for physically based animation CSE 3541 Matt Boggus

Integration – derivative field

For arbitrary function, f(t)

The force acting on a point may vary in space

Page 7: Integration for physically based animation CSE 3541 Matt Boggus

SamplingA fixed amount of time passes between frames.Approximate the continuous position curve with discrete samples.

Page 8: Integration for physically based animation CSE 3541 Matt Boggus

Integration and step size

2.0x

5x

Page 9: Integration for physically based animation CSE 3541 Matt Boggus

Inaccuracy and instability

Page 10: Integration for physically based animation CSE 3541 Matt Boggus

Runge Kutta Integration: 2nd orderaka Midpoint Method

• Compute a “full” Euler step

• Evaluate f at midpoint

• Take a step from the original point using the midpoint f value

Page 11: Integration for physically based animation CSE 3541 Matt Boggus

Runge Kutta Integration: 2nd orderaka Midpoint Method

For unknown function, f(t); known f ’(t)

)( itf

)( itf ttftftfi

ii

)()()(2

11

)(2

1

itf

ttftftf iii

)(2

1)()(

2

1

Page 12: Integration for physically based animation CSE 3541 Matt Boggus

Step size 2t

Euler Integration

Midpoint Method

Page 13: Integration for physically based animation CSE 3541 Matt Boggus

Integration comparison

Image from http://www.physics.drexel.edu/students/courses/Comp_Phys/Integrators/simple.html