830 likes | 843 Views
CSCE 441: Keyframe Animation/Smooth Curves (Cont.). Jinxiang Chai. Key-frame Interpolation. Given parameter values at key frames, how to interpolate parameter values for inbetween frames. θ. t. Key-frame Interpolation.
E N D
CSCE 441: Keyframe Animation/Smooth Curves (Cont.) Jinxiang Chai
Key-frame Interpolation • Given parameter values at key frames, how to interpolate parameter values for inbetween frames. θ t
Key-frame Interpolation • Given parameter values at key frames, how to interpolate parameter values for inbetween frames. θ t
Key-frame Interpolation • Given parameter values at key frames, how to interpolate parameter values for inbetween frames. θ t Nonlinear interpolation
Review: Natural cubic curves • Properties: • Go through four control points • not good for local control
R1 P4 R4 P1 Review: Hermite Curves P1: start position P4: end position R1: start derivative R4: end derivative
R1 P4 R4 P1 Review: Hermite Curves
R1 P4 R4 P1 Review: Hermite Curves Herminte basis matrix
R1 P4 R4 P1 Review: Hermite Curves Herminte basis matrix
R1 P4 R4 P1 Review: Hermite Curves
R1 P4 R4 P1 Review: Hermite Curves
R1 P4 R4 P1 Review: Hermite Curves
R1 P4 R4 P1 Review: Hermite Curves
R1 P4 R4 P1 Review: Hermite Curves Hermite basis functions
R1 P4 R4 P1 Review: Hermite Curves basis function 1 basis function 2 basis function 3 basis function 4
R1 P4 R4 P1 Review: Hermite Curves *R1 *R4 *P1 + *P4 + + =
Review: Bezier Curves *v2 *v3 *v1 *v0 + + + =
Review: Different basis functions • Cubic curves: • Hermite curves: • Bezier curves:
Complex curves Suppose we want to draw or interpolate a more complex curve
Complex curves • Suppose we want to draw or interpolate a more complex curve How can we represent this curve?
Complex curves • Suppose we want to draw a more complex curve • Idea: we’ll splice together a curve from individual segments that are cubic Béziers
Complex curves • Suppose we want to draw or interpolate a more complex curve • Idea: we’ll splice together a curve from individual segments that are cubic Béziers
Splines • A piecewise polynomial that has a locally very simple form, yet be globally flexible and smooth
Splines • There are three nice properties of splines we’d like to have - Continuity - Local control - Interpolation
Continuity • C0: points coincide, velocities don’t • C1: points and velocities coincide • What’s C2? - points, velocities and accelerations coincide
Continuity • Cubic curves are continuous and differentiable • We only need to worry about the derivatives at the endpoints when two curves meet
Local control • We’d like our spline to have local control - that is, have each control point affect some well-defined neighborhood around that point
Local control • We’d like our spline to have local control - that is, have each control point affect some well-defined neighborhood around that point
Local control • We’d like our spline to have local control - that is, have each control point affect some well-defined neighborhood around that point
Interpolation • Bézier curves are approximating - The curve does not (necessarily) pass through all the control points - Each point pulls the curve toward it, but other points are pulling as well - the curve is always located within the convex hull based on control points. • Instead, we may prefer a spline that is interpolating - That is, that always passes through every control point
B-splines • We can join multiple Bezier curves to create B-splines • Ensure C2 continuity when two curves meet
Derivatives at end points t=1 t=0
Derivatives at end points t=1 t=0
Derivatives at end points t=1 t=0
Derivatives at end points t=1 t=0
Derivatives at end points t=1 t=0
Continuity in B splines • Suppose we want to join two Bezier curves (V0, V1, V2,V3) and (W0, W1, W2, W3) so that C2 continuity is met at the joint
Continuity in B splines • Suppose we want to join two Bezier curves (V0, V1, V2,V3) and (W0, W1, W2, W3) so that C2 continuity is met at the joint
Continuity in B splines • Suppose we want to join two Bezier curves (V0, V1, V2,V3) and (W0, W1, W2, W3) so that C2 continuity is met at the joint
Continuity in B splines • Suppose we want to join two Bezier curves (V0, V1, V2,V3) and (W0, W1, W2, W3) so that C2 continuity is met at the joint
Continuity in B splines • Suppose we want to join two Bezier curves (V0, V1, V2,V3) and (W0, W1, W2, W3) so that C2 continuity is met at the joint
Continuity in B splines • Suppose we want to join two Bezier curves (V0, V1, V2,V3) and (W0, W1, W2, W3) so that C2 continuity is met at the joint
Continuity in B splines What does this derived equation mean geometrically? - What is the relationship between a, b and c, if a = 2b - c? b is the middle point of a and c. w2=v1+4v3-4v2