Paper Summaries Any takers? Interpolation Projects Factoids - - PDF document

paper summaries
SMART_READER_LITE
LIVE PREVIEW

Paper Summaries Any takers? Interpolation Projects Factoids - - PDF document

Paper Summaries Any takers? Interpolation Projects Factoids Proposals due next week. Digital Video Frame Rate Star Wars was shot at 24 fps. Keep film look Plan for today Motivation Films Keyframing and


slide-1
SLIDE 1

1

Interpolation

Paper Summaries

  • Any takers?

Projects

  • Proposals due next week.

Factoids

  • Digital Video Frame Rate

– Star Wars was shot at 24 fps. – Keep film look

Plan for today

  • Keyframing and Interpolation
  • But first…

Motivation Films

  • Two early attempts of significant use of CG

elements in film

slide-2
SLIDE 2

2

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 on a Cray computer.

  • Lesson Learned from Last Starfighter

– Great effects – Bad movie – Overestimated the “Geek Factor”

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)

slide-3
SLIDE 3

3

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.

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 (in this case of time)

  • F(t)
slide-4
SLIDE 4

4

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?

Linear Interpolation

  • The simplest solution

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

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 – Direct relationship between time and value

  • Cons

– Lacks tangential continuity – Why is this important?

slide-5
SLIDE 5

5

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 t
  • Approximated by cubic polynomials

x x x x

d t c t b t a t x + + + =

2 3

) (

y y y y

d t c t b t a t y + + + =

2 3

) (

z z z z

d t c t b t a t z + + + =

2 3

) (

Cubic Interpolation

[ ]

1

2 3

t t t T =

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

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

[ ]

) ( ) ( ) ( ) ( t z t y t x t Q =

C T 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

Cubic Interpolation

  • Basis & Control points distinguishes types of

curves

{

{

control basis

) ( G M T t Q ⋅ ⋅ =

Cubic Interpolation

  • Hermite Curves

– specified by endpoints and tangent vectors from each endpoint

slide-6
SLIDE 6

6

Cubic Interpolation

  • Hermite Curves

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

H

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

4 1 4 1

R R P P GH

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

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

slide-7
SLIDE 7

7

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

– DeCastelau 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 of

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

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

slide-8
SLIDE 8

8

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

[ ]

) ( ) ( ) ( ) ( ) ( t W t Z t Y t X t Q = ) ( ) ( ) ( , ) ( ) ( ) ( , ) ( ) ( ) ( t W t Z t z t W t Y t y t W t X t 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

Cubic Interpolation

  • Pros

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

  • Cons

– Spline control does not correspond to time. – May require an interactive “curve editor” tool.

Cubic Splines

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

slide-9
SLIDE 9

9

Cubic Splines

  • 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)

Cubic Splines

  • Solution

– Determine:

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

– Then

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

Cubic Splines

  • 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 u = 0.46

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 or

leaves the ground and slower as it approaches leaves its maximum position

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.
slide-10
SLIDE 10

10

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

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 ) 15 . 20 . ( 22 . 15 . ) 25 . ( − + = u

slide-11
SLIDE 11

11

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?

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

  • +

=

  • =

θ

slide-12
SLIDE 12

12

Let’s go to assignment 1