Top Banner
Keyframe Interpolation and Speed Control Jehee Lee Seoul National University
16

Keyframe Interpolation and Speed Control Jehee Lee Seoul National University.

Jan 17, 2018

Download

Documents

Blaise Oliver

Reparameterization A parametric function P(u) = (x(u), y(u), z(u)) defines a motion –The parameter u is not actually time –A parameter u(t) is a function of time t Typical process of keyframing –First, P(u) is designed to specify the trajectory –Reparameterization function u(t) is designed later to reflect proper speed and timing –demo2_jingle_bells.avidemo2_jingle_bells.avi
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Keyframe Interpolation and Speed Control Jehee Lee Seoul National University.

Keyframe Interpolation and Speed Control

Jehee LeeSeoul National University

Page 2: Keyframe Interpolation and Speed Control Jehee Lee Seoul National University.

Controlling the Motion Along a Curve

• A parametric function P(t) = (x(t), y(t), z(t)) defines a motion– The parameter t is time– The position at time t is given by x(t), y(t), and z(t)

• This function defines both– Spatial trajectory, and– Speed of movement along the trajectory

• It is often very difficult for animators to design a curve that gives desired trajectory and speed simultaneously

Page 3: Keyframe Interpolation and Speed Control Jehee Lee Seoul National University.

Reparameterization

• A parametric function P(u) = (x(u), y(u), z(u)) defines a motion– The parameter u is not actually time– A parameter u(t) is a function of time t

• Typical process of keyframing– First, P(u) is designed to specify the trajectory– Reparameterization function u(t) is designed later to r

eflect proper speed and timing– demo2_jingle_bells.avi

Page 4: Keyframe Interpolation and Speed Control Jehee Lee Seoul National University.

Reparameterization

• How do we determine u(t) ?– Arc length parameterization u(s)

– Speed control s(t)• Distance-time function• Ease-In/Ease-Out

))(),(( 1212 susuLENGTHsss

The length along the space curve p(u) from the point p(u1) to the point p(u2)

)))((()( tsuPtP

Page 5: Keyframe Interpolation and Speed Control Jehee Lee Seoul National University.

Arc Length Parameterization

• The length of the curve

– A cubic polynomial p(u) cannot, in general, be parameterized by arc length in a closed form

udududz

ududy

ududx

udududp

uuLENGTHs

u

u

u

u

~~)~(

~)~(

~)~(

~~)~(

),(

0

0

222

0

Page 6: Keyframe Interpolation and Speed Control Jehee Lee Seoul National University.

Chord Length Approximation

• Approximation by chord length– Sample the curve at a multitude of

parametric values• Ex) u1, u2, …, un

– Estimate the arc length by computing the linear distance through the sequence of samples

3u

2u

1u

)(su

s0d 10 dd 210 ddd

)( 0up

)( 1up

)( 2up

)()( 010 upupd

1d

)( 3up

2d

u(s) is monotonically increasing with respect to s

Page 7: Keyframe Interpolation and Speed Control Jehee Lee Seoul National University.

Chord Length Approximation

• Adaptive sampling– Add a new sample at the midpoint

between two adjacent points p(ui) and p(ui+1) if the total length changes above given tolerance

– Repeat until there is no more point to add

)( 0up

)( 1up

)( 2up

)()( 010 upupd

1d

)( 3up

2d

Page 8: Keyframe Interpolation and Speed Control Jehee Lee Seoul National University.

Computing Arc Length Numerically

• Numerical integration

– Evenly spaced sample intervals• Trapezoidal rule (piecewise linear)• Simson’s rule (piecewise quadratic)

– Unevenly spaced sample intervals• Gaussian quadrature is commonly used• Adaptive sampling is also possible

udududz

ududy

ududx

uuLENGTHsu

u

~~)~(

~)~(

~)~(

),(

0

222

0

Page 9: Keyframe Interpolation and Speed Control Jehee Lee Seoul National University.

Computing Arc Length Numerically

• Finding u given s– Can be formulated as a root finding problem

– Newton-Raphson iteration is commonly used• Solution is unique if dp(u)/du is not identically zero

over some interval

0),()( 0 uuLENGTHsuf

Page 10: Keyframe Interpolation and Speed Control Jehee Lee Seoul National University.

Speed Control

• Speed control function relates an equally spaced parametric value (e.q., time) to arc length– Input: time t– Output: arc length s(t)– it is a distance-time function

• Normalized arc length– Arc length divided by the total length– Varies from 0 to 1– Sometimes, the normalized arc length parameter will s

till be referred to simply as the arc length

Page 11: Keyframe Interpolation and Speed Control Jehee Lee Seoul National University.

Ease-In / Ease-Out

• Sine interpolation

21)2/sin()()(

tteasets

Page 12: Keyframe Interpolation and Speed Control Jehee Lee Seoul National University.

Ease-In / Ease-Out

• Using sinusoidal pieces for acceleration and deceleration

Page 13: Keyframe Interpolation and Speed Control Jehee Lee Seoul National University.

Ease-In / Ease-Out

• Constant Acceleration

Page 14: Keyframe Interpolation and Speed Control Jehee Lee Seoul National University.

Ease-In / Ease-Out

• Constant Acceleration– Parabolic ease-in/ease-out

Page 15: Keyframe Interpolation and Speed Control Jehee Lee Seoul National University.

General Distance-Time Functions

• The user may work directly with the distance-time curve– Eg). Bezier, B-splines, cubi

c interpolating splines

Page 16: Keyframe Interpolation and Speed Control Jehee Lee Seoul National University.

Summary

• Decouple trajectory and parameterization– Arc length parameterization– Speed control

• Commercial animation systems provides UI for designing space curves and speed control curves separately

• Timing actually affects trajectory• Timing is often specified by performance• demo.wmv