Paper Summaries Any takers? Interpolation Papers for interpolation - - PDF document

paper summaries
SMART_READER_LITE
LIVE PREVIEW

Paper Summaries Any takers? Interpolation Papers for interpolation - - PDF document

Paper Summaries Any takers? Interpolation Papers for interpolation Projects Logistics Proposals due Wednesday. E-mail. Who didnt get any? Jobs, Jobs, Jobs Plan for today and I dont mean Steve!


slide-1
SLIDE 1

1

Interpolation

Paper Summaries

Any takers? Papers for interpolation…

Projects

Proposals due Wednesday.

Logistics

E-mail….

Who didn’t get any?

Jobs, Jobs, Jobs

…and I don’t mean Steve! Intel is looking for Graphics people

2D MPEG/video 3D For those graduating soon. Resumes to Raun Krisch (by Friday)

Plan for today

Keyframing and Interpolation But first…

slide-2
SLIDE 2

2

Motivation Films

Two early attempts of significant use of

CG elements in film

Motivational Film

TRON

Disney (1982) Clips shown at SIGGRAPH 82

Motivational Film

Question from SIGGRAPH Bowl

Q: Which special effects company was

responsible for the effects of TRON?

A: ALL OF THEM

MAGI Triple I Robert Abel & Associates Digital Effects

Motivational Film

Interesting TRON Factoid

No polygons! All objects were defined using

mathematical formula.

Lesson Learned from TRON

Great effects Bad movie Overestimated the “Geek Factor”

Motivational Film

The Last Starfighter (1985)

Effects by Digital Productions Universal Pictures

Motivational Film

Last Starfighter factoids

First movie to do all special effects (except

makeup) on a computer.

All shots of spacecraft, space, etc. were generated

  • n a Cray computer.

Lesson Learned from Last Starfighter

Great effects Bad movie Overestimated the “Geek Factor”

slide-3
SLIDE 3

3

Motivational Film

Life imitating art imitating life…

Sort of… A prototype for A Last Starfighter video

game was produced by Atari (remember them?) but was never distributed.

Note that there WAS a TRON video game

(made by Bally/Midway – 1983)

Let’s get started

Key framing and interpolation

  • 6. Straight ahead action and Pose-to-pose

action

The two main approaches to hand drawn

animation.

Straight ahead action

“the animator works straight ahead from his first drawing

in the scene.”

Pose-to-pose (keyframing)

the animator plans his actions, figures out just what

drawings will be needed to animate the business, makes the drawings concentrating on the poses, ... and then draws the inbetweens.”

Link

Key framing

The simplest form of animating an object. Object has:

A beginning state An end state A number of intermediate “key” states

It is up to the keyframe system to determine

the states for inbetween frames

Key Framing

P1 P2 P3 P4 P5 P6

Time = 0 Time = 10 Time = 35 Time = 50 Time = 55 Time = 60

Key Framing

60 sec animation

Video: 30 frames / sec = 1800 frames We have 6 key frames Need to create position of objects for the

remaining 1794 frames.

slide-4
SLIDE 4

4

Interpolation

According to webster.com

in·ter·po·late (n) - to estimate values of

(a function) between two known values

Note: “state” can be defined as a function

F(u)

Interpolation

Things to consider:

Interpolation or approximation?

Interpolation – Control points fall on the curve Approximation – Control points fall outside the

curve.

Interpolation

Things to consider:

Continuity – defines “smoothness” of curve. Determined by how many derivatives are

continuous

0th order – are the curves attached at the points

themselves (positional continuity)

1st order – is the first derivative continuous (tangential

continuity)

2nd order – is the 2nd derivative continuous (curvature

continuity)

Interpolation – Continuity

No positional continuity Order 1 Continuity Order 0 continuity 2nd order continuity For animation purposes, Tangential (1st Order) continuity is usually sufficient

Interpolation

Things to consider:

Local vs. Global control

Does changing one point change the entire

function?

Questions?

Interpolation

in·ter·po·late (n) - to estimate values of (a

function) between two known values

Function f (u)

u = interpolation control variable

Two known values

P1 = f(0) P2 = f(1)

Interpolation scheme will provide value of the

function for u between 0 and 1

Some interpolation schemes will require additional points to

perform interpolation

slide-5
SLIDE 5

5

Linear Interpolation

The simplest solution

P(0) = P0 P(1) = P1 P(u)

1

) 1 ( ) ( P u P u u P ⋅ + ⋅ − =

1

) ( ) ( P u P P u P + ⋅ − =

Also can be expressed as

Linear Interpolation

Pros

Straight-forward Easy to implement

Cons

Lacks tangential continuity Why is this important?

Remember our principles of animation?

  • 8. Arcs

“The visual path of action from one

extreme to another is always described by an arc.”

This is not an arc!

Cubic Interpolation

x, y, z given as function of u Approximated by cubic polynomials x x x x

d u c u b u a u x + + + =

2 3

) (

y y y y

d u c u b u a u y + + + =

2 3

) (

z z z z

d u c u b u a u z + + + =

2 3

) (

Cubic Interpolation

[ ]

1

2 3

u u u U =

⎥ ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ =

z z z z y y y y x x x x

d c b a d c b a d c b a C

[ ]

) ( ) ( ) ( ) ( u z u y u x u Q =

C U Q ⋅ =

Cubic Interpolation

Separate C matrix into basis +

geometry 4 4 3 4 4 2 1 4 4 4 4 3 4 4 4 4 2 1

points control 4 3 2 1 4 3 2 1 4 3 2 1 matrix basis 44 43 42 41 34 33 32 31 24 23 22 21 14 13 12 11

⎥ ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ =

z z z z y y y y x x x x

G G G G G G G G G G G G m m m m m m m m m m m m m m m m C

slide-6
SLIDE 6

6

Cubic Interpolation

Basis & Control points distinguishes types of

curves

{

{

control basis

) ( G M U u Q ⋅ ⋅ =

Cubic Interpolation

Hermite Curves

specified by endpoints and tangent vectors

from each endpoint

Cubic Interpolation

Hermite Curves

⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ − − − − = 1 1 1 2 3 3 1 1 2 2

H

M ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ ′ ′ =

+ + 1 1 i i i i H

P P P P G

Let’s go to the video tape

Cubic Interpolation

Problem with Hermite Curves

Animator generally will not enjoy specifying

tangent vectors

Solution: The Catmull-Rom spline

Cubic Interpolation

Catmull-Rom spline

Uses previous and next control point to determine

tangent vector

Spline goes through all control points!

Cubic Interpolation

Catmull-Rom

⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ − − − − − = 2 1 1 1 4 5 2 1 3 3 1 2 1

CR

M ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ =

+ + − 2 1 1 i i i i CR

P P P P G Note: for interpolation between Pi and Pi+1 you need 4 points

Let’s go to the video tape

slide-7
SLIDE 7

7

Cubic Interpolation

Bezier Curves

specified by endpoints and intermediate

points, not on the curve, that approximate the tangent vectors

Cubic Interpolation

Bezier Curves

⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ − − − − − = 1 3 3 3 6 3 1 3 3 1

B

M ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ =

3 2 1

P P P P GH

Let’s go to the video tape

Cubic Interpolation

Bezier Curves suffer from same problem as

Hermite Curves

Animator generally will not enjoy specifying

tangent vectors…even from control points

Exception: Provide animator with an interactive curve

editor

DeCasteljau Construction

Algorithm to automatically define Bezier control points Described in Parent Appendix and Shomake Quat. paper

Cubic Interpolation

B-Splines

Control points are outside of the curve Local control

Moving one control point only affects a portion

  • f the entire curve.

Individual curve segments share control

points.

Knots - points connecting individual curve

segments.

Cubic Interpolation

B-Splines

Cubic Interpolation

B-Splines - local control

slide-8
SLIDE 8

8

Cubic Interpolation

Segment Qi uses control points Pi-3, Pi-2, Pi-1 and Pi

Cubic Interpolation

B-Splines

⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ − − − − − = 1 4 1 3 3 3 6 3 1 3 3 1 6 1

B

M ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ =

− − − i i i i H

P P P P G

1 2 3

Let’s go to the video tape

Cubic Interpolation

Uniform Nonrational B-Splines

uniform - knots are equally spaced nonrational - does not use homogeneous

coordinates (more on this later)

B - basis -- curves are weighted sums of a

basis function

Cubic Interpolation

Rational Splines

expressed using homogeneous coordinates

[ ]

) ( ) ( ) ( ) ( ) ( u W u Z u Y u X u Q = ) ( ) ( ) ( , ) ( ) ( ) ( , ) ( ) ( ) ( u W u Z u z u W u Y u y u W u X u x = = =

Cubic Interpolation

Rational splines -- why bother?

Invariant under rotation, scaling,

translation, and perspective transforms

Can define precisely any of the conic

  • sections. (spheres, ellipsoids, parabolids,

etc)

Cubic Interpolation

NURBS

Non-uniform Rational B-Splines Non-uniform - knots need not be equally

spaced.

Most useful and used method for

representing surface curves in CG.

Probably overkill for cubic interpolation

slide-9
SLIDE 9

9

Cubic Interpolation

Pros

We now have our tangential continuity More complex than linear but not too

complex

Cons

May require an interactive “curve editor”

tool.

Questions

Interpolating Quaternions

Normalized Quaternions are defined on the

unit 4D sphere

Linear interpolation generates unequal

spacing when projected onto circle

Interpolating Quaternions

Spherical Linear Interpolation

where

θ θ θ θ sin ) sin( sin ) ) 1 sin(( ) , ( slerp

2 1 , 2 1

u q u q u q q + − =

) ( cos

2 1 2 1 2 1

v v s s q q

  • +

=

  • =

θ Interpolating Quaternions

Note:

Spherical Linear Interpolation has the same

problem as linear interpolation (no tangential continuity)

For smooth interpolation, Shomake recommends:

Bezier curves using DeCasteljau construction of control

points

Use slerp in constructing these points See SHOMAKE paper or text for details.

Determining interpolated path

Linear Interpolation Cubic Interpolation

Hermite Catmull-Rom Bezier B-Splines

Interpolation of quaternions. Break.

Interpolation

Position / Orientation isn’t the only

thing that can be interpolated.

Frightening face demo Any value that changes over time is a

candidate.

slide-10
SLIDE 10

10

Interpolation and time

u=1/3 u=2/3 u=0.0 u=1.0 u does not correspond to t.

Interpolation and time

Our problem

Spline control does not correspond to time. What we have

P(u) – position w.r.t. spline control

What we need

P(t) – position w.r.t. time (note we have this

for control points)

Interpolation and time

Solution

Determine:

u(t) – spline control w.r.t time

Then

P(t) = P (u(t))

Interpolation and time

Solution

Determine:

U(t) – spline control w.r.t time

Then

P(t) = P (U(t))

Can use interpolation on u(t) using t at control

points

Linear Cubic

Questions?

Cubic Splines

P1 P2 P3 P4 P5 P6

Time = 0 Time = 10 Time = 35 u = 0.0 Time = 50 u=1.0 Time = 55 Time = 60 at t = 42.5 u = 0.5

Let’s Take this a Step Further

  • 7. Slow In and Slow Out

Refers to the spacing of the inbetween

frames at maximum positions.

Example:

a bouncing ball moves faster as it approaches

  • r leaves the ground and slower as it

approaches leaves its maximum position

slide-11
SLIDE 11

11

Let’s Take this a Step Further

Suppose animator knows path but

wants more control over speed?

What we have

P(u) – position w.r.t. spline control

Note that this is NOT

S(u) – length traveled w.r.t. spline control.

And we need to give animator control of

S(t) – length traveled at a given time.

Let’s Take this a Step Further

Suppose animator knows path but wants

more control over speed?

What we have

P(u) – position w.r.t. spline control

What we need

U(S) – length w.r.t. spline control

And let animator define

S(t) – length w.r.t. time (velocity/speed)

Then

P(t) = P (U (S (t)))

Arc Length

Arc Length = distance traveled along a

curve.

Mathematically defined as:

du du dP u u s

u u

=

2 1

) , (

2 1

Arc Length

So, arc length is an integral

Ways to solve

Analytic – integral not always solvable Numerical Integration – more when we talk

about physics.

Forward Differencing

Arc Length

Forward Differencing

Sample the curve at equally spaced u values. Estimate arc length by calculating linear distance

between sampled points.

For example,

Given P(u) calculate at u= 0.00, 0.05, 0.10, 0.15, … Define arc length s(u) s (0.0) = 0.0 s (0.05) = distance between P(0.05) and P(0.0) s (0.1) = s (0.05) + distance between P(0.10) and P(0.05) Etc.

Arc Length

Forward Differencing

This will give us a mapping from P(u) to

s(u) for sampled u values.

Perform interpolation (linear or cubic)

between sampled values

slide-12
SLIDE 12

12

Arc Length

s(u) u

Idx

0.720 0.40

8

0.600 0.35

7

0.500 0.30

6

0.400 0.25

5

0.320 0.20

4

0.230 0.15

3

0.150 0.10

2

0.080 0.05

1

0.000 0.00

Find u corresponding to s = 0.25 Find closest idx to s = 0.25 Find relative distance to s for next idx

222 . 23 . 32 . 23 . 25 . = − −

Linearly interpolate u 161 . ) 15 . 20 . ( 22 . 15 . ) 25 . ( = − + = u

Animator control of speed

Animator can define s(t)

Length traveled w.r.t time Speed

Basic ease-in/ease out

Ease-in/ease out summary

Animator defines speed

Arc length given time

Ease-in/ease out summary

Spline control determined by forward

differencing

222 . 23 . 32 . 23 . 25 . = − −

Linearly interpolate u 161 . ) 15 . 20 . ( 22 . 15 . ) 25 . ( = − + = u Find u corresponding to s = 0.25 Find closest idx to s = 0.25 Find relative distance to s for next idx

Ease-in/ease out summary

Position determined by spline

P = P (0.161) Questions?

Let’s go to assignment 1