CSCE 441: Keyframe Animation/Smooth Curves (Cont.) Jinxiang Chai.

Slides:



Advertisements
Similar presentations
Arc-length computation and arc-length parameterization
Advertisements

© University of Wisconsin, CS559 Spring 2004
Lecture 10 Curves and Surfaces I
Geometric Modeling Notes on Curve and Surface Continuity Parts of Mortenson, Farin, Angel, Hill and others.
Cubic Curves CSE167: Computer Graphics Instructor: Steve Rotenberg UCSD, Fall 2006.
Animation Following “Advanced Animation and Rendering Techniques” (chapter 15+16) By Agata Przybyszewska.
Cubic Curves CSE169: Computer Animation Instructor: Steve Rotenberg UCSD, Winter 2005.
CS 445/645 Fall 2001 Hermite and Bézier Splines. Specifying Curves Control Points –A set of points that influence the curve’s shape Knots –Control points.
© University of Wisconsin, CS559 Spring 2004
B-Spline Blending Functions
1 Introduction Curve Modelling Jack van Wijk TU Eindhoven.
Computer Animation Algorithms and Techniques
Dr. S.M. Malaek Assistant: M. Younesi
1 Curves and Surfaces. 2 Representation of Curves & Surfaces Polygon Meshes Parametric Cubic Curves Parametric Bi-Cubic Surfaces Quadric Surfaces Specialized.
Slide 127 October 1999CS Computer Graphics (Top Changwatchai) Review of Spline Concepts Sections 10-6 to in Hearn & Baker Splines can be 2D.
Splines II – Interpolating Curves
1Notes  Assignment 0 is being marked  Textbook reference for arc-length parameterization:  Section 3.2.
Curves Chiew-Lan Tai.
Curves Chiew-Lan Tai. Curves 2 Reading Required Hearn & Baker, 8-8 – 8-10, 8-12 Foley, 11.2.
CSCE 441 Computer Graphics: Keyframe Animation/Smooth Curves Jinxiang Chai.
Curves Locus of a point moving with one degree of freedom
Curves Mortenson Chapter 2-5 and Angel Chapter 9
Modelling: Curves Week 11, Wed Mar 23
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Curves Week 13, Mon 24 Nov 2003.
Bezier and Spline Curves and Surfaces CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
COEN Computer Graphics I
Curve Surfaces June 4, Examples of Curve Surfaces Spheres The body of a car Almost everything in nature.
Splines III – Bézier Curves
Curve Modeling Bézier Curves
Bresenham’s Algorithm. Line Drawing Reference: Edward Angel’s book: –6 th Ed. Sections 6.8 and 6.9 Assuming: –Clipped (to fall within the window) –2D.
11/19/02 (c) 2002, University of Wisconsin, CS 559 Last Time Many, many modeling techniques –Polygon meshes –Parametric instancing –Hierarchical modeling.
A D V A N C E D C O M P U T E R G R A P H I C S CMSC 635 January 15, 2013 Spline curves 1/23 Curves and Surfaces.
(Spline, Bezier, B-Spline)
V. Space Curves Types of curves Explicit Implicit Parametric.
Curves.
Computer Animation Rick Parent Computer Animation Algorithms and Techniques Interpolating Values.
INTERPOLATION & APPROXIMATION. Curve algorithm General curve shape may be generated using method of –Interpolation (also known as curve fitting) Curve.
CO Games Development 1 Week 12 Interpolation, Path Smoothing & Splines
University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell Parametric Curves.
Splines IV – B-spline Curves based on: Michael Gleicher: Curves, chapter 15 in Fundamentals of Computer Graphics, 3 rd ed. (Shirley & Marschner) Slides.
CSCE 441 Computer Graphics: Keyframe Animation/Smooth Curves Jinxiang Chai.
CSCE 441 Computer Graphics: Keyframe Animation/Smooth Curves Jinxiang Chai.
04/18/02(c) 2002 University of Wisconsin Last Time Hermite Curves Bezier Curves.
Trajectory Generation
Curves: ch 4 of McConnell General problem with constructing curves: how to create curves that are “smooth” CAD problem Curves could be composed of segments.
Greg Humphreys CS445: Intro Graphics University of Virginia, Fall 2003 Parametric Curves & Surfaces Greg Humphreys University of Virginia CS 445, Spring.
Splines I – Curves and Properties based on: Michael Gleicher Curves, chapter 15 in Fundamentals of Computer Graphics, 3 rd ed. (Shirley & Marschner) Slides.
Rick Parent - CIS681 Interpolation and Basic Techniques Representing and interpolating orientations Interpolation Speed control along curve Path following.
Parametric Curves CS 318 Interactive Computer Graphics John C. Hart.
CSCE 441: Keyframe Animation/Smooth Curves (Cont.) Jinxiang Chai.
(c) 2002 University of Wisconsin
Designing Parametric Cubic Curves 1. 2 Objectives Introduce types of curves ­Interpolating ­Hermite ­Bezier ­B-spline Analyze their performance.
1 Graphics CSCI 343, Fall 2015 Lecture 34 Curves and Surfaces III.
CS 450: Computer Graphics PARAMETRIC SPLINES AND SURFACES
Keyframe Interpolation and Speed Control Jehee Lee Seoul National University.
CS559 – Curves Lecture These are course notes (not used as slides) Written by Mike Gleicher, Oct Updates Oct 2006, 2007 Updates Oct 2008 © 2005 Michael.
Rendering Bezier Curves (1) Evaluate the curve at a fixed set of parameter values and join the points with straight lines Advantage: Very simple Disadvantages:
Rick Parent - CIS681 Interpolation of a time-space curve Interpolation (of a curve in space) Speed control along curve Reparameterizing according to arc.
Curves University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2013 Tamara Munzner.
CS552: Computer Graphics Lecture 19: Bezier Curves.
Piecewise Polynomial Parametric Curves Sun-Jeong Kim.
Introduction to Parametric Curve and Surface Modeling.
CSCI480/582 Lecture 9 Chap.2.2 Cubic Splines – Hermit and Bezier Feb, 11, 2009.
© University of Wisconsin, CS559 Spring 2004
CSCE 441 Computer Graphics: Keyframe Animation/Smooth Curves
CSCE 441 Computer Graphics: Keyframe Animation/Smooth Curves
© University of Wisconsin, CS559 Spring 2004
Interpolation and Basic Techniques
CSCE 441: Keyframe Animation/Smooth Curves (Cont.)
Introduction to Parametric Curve and Surface Modeling
Presentation transcript:

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 cruves

Review: Natural cubic curves Properties: - Go through four control points - not good for local control

Review: Hermite Curves P1P1 R1R1 P4P4 R4R4 P 1 : start position P 4 : end position R 1 : start derivative R 4 : end derivative

Review: Hermite Curves P1P1 R1R1 P4P4 R4R4

P1P1 R1R1 P4P4 R4R4 Herminte basis matrix

Review: Hermite Curves P1P1 R1R1 P4P4 R4R4 Herminte basis matrix

Review: Hermite Curves P1P1 R1R1 P4P4 R4R4

P1P1 R1R1 P4P4 R4R4

P1P1 R1R1 P4P4 R4R4

P1P1 R1R1 P4P4 R4R4

P1P1 R1R1 P4P4 R4R4 Hermite basis functions

Review: Hermite Curves P1P1 R1R1 P4P4 R4R4 basis function 1basis function 2basis function 3 basis function 4

Review: Hermite Curves P1P1 R1R1 P4P4 R4R4 *P 1 *P 4 *R 1 *R =

Review: Bezier Curves

*v 0 *v 1 *v 2 *v =

Cubic curves: Hermite curves: Bezier curves: Review: Different basis functions

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 C 0 : points coincide, velocities don’t C 1 : points and velocities coincide What’s C 2 ? - 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 C 2 continuity when two curves meet

Derivatives at end points

Continuity in B splines Suppose we want to join two Bezier curves (V 0, V 1, V 2,V 3 ) and (W 0, W 1, W 2, W 3 ) so that C 2 continuity is met at the joint

Continuity in B splines Suppose we want to join two Bezier curves (V 0, V 1, V 2,V 3 ) and (W 0, W 1, W 2, W 3 ) so that C 2 continuity is met at the joint

Continuity in B splines Suppose we want to join two Bezier curves (V 0, V 1, V 2,V 3 ) and (W 0, W 1, W 2, W 3 ) so that C 2 continuity is met at the joint

Continuity in B splines Suppose we want to join two Bezier curves (V 0, V 1, V 2,V 3 ) and (W 0, W 1, W 2, W 3 ) so that C 2 continuity is met at the joint

Continuity in B splines Suppose we want to join two Bezier curves (V 0, V 1, V 2,V 3 ) and (W 0, W 1, W 2, W 3 ) so that C 2 continuity is met at the joint

Continuity in B splines Suppose we want to join two Bezier curves (V 0, V 1, V 2,V 3 ) and (W 0, W 1, W 2, W 3 ) so that C 2 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. w 2 =v 1 +4v 3 -4v 2

de Boor points Instead of specifying the Bezier control points, let’s specify the corners of the frames that forms a B-spline These points are called de Boor points and the frames are called A-frames

de Boor points What is the relationship between Bezier control points and de Boor points? Verify this by yourself!

B spline basis matrix

Building complex splines Constraining a Bezier curve made of many segments to be C 2 continuous is a lot of work - for each new segment we have to add 3 new control point - only one of the control points is really free B-splines are easier (and C 2 ) - First specify 4 vertices (de Boor points), then one per segment

B splines properties √ Continuity √ Local control x Interpolation

Catmull-Rom splines If we are willing to sacrifice C 2 continuity, we can get interpolation and local control. If we set each derivative to be a constant multiple of the vector between the previous and the next control points, we get a Catmull-Rom spline

Catmull-Rom splines

The segment is controlled by p 1,p 2,p 3,p 4 0.5

Catmull-Rom splines The segment is controlled by p 1,p 2,p 3,p 4

Catmull-Rom splines The effect of t: how sharply the curve bends at the control points

Catmull-Rom splines The segment is controlled by p 1,p 2,p 3,p 4

Catmull-Rom splines From Hermite curves

Catmull-Rom splines From Hermite curves

Catmull-Rom splines From Hermite curves

Catmull-Rom splines

What do we miss?

Catmull-Rom splines ? ?

Catmull-Rom splines have C 1 continuity (not C 2 continuity) Do not lie within the convex hull of their control points.

Catmull-Rom splines Catmull-Rom splines have C 1 continuity (not C 2 continuity) Do not lie within the convex hull of their control points.

Catmull-Rom splines properties X Continuity (C 2 ) √ Local control √ Interpolation

Keyframe Interpolation t=0 t=50ms

Curves in the animation Interpolate each parameter separately Each animation parameter is described by a 2D curve Q(u) = (x(u), y(u)) Treat this curve as θ = y(u) t = x(u) where θ is a variable you want to animate and t is a time index. We can think of the results as a function: θ(t) u u θ t

Keyframing interpolation is a two-step algorithm: - Compute the spline parameter u corresponding to the time t: u t=x(u)

Keyframing interpolation is a two-step algorithm: - Compute the spline parameter u corresponding to the time t: how to evaluate the inverse function?

Keyframing interpolation is a two-step algorithm: Compute the spline parameter u corresponding to the time t: how to evaluate the inverse function? - linear function: easy (t=u) - complex function: finite difference or numerically root finding

Keyframing interpolation is a two-step algorithm: Compute the spline parameter u corresponding to the time t: how to evaluate the inverse function? - linear function: easy - complex function: finite difference or numerically root finding Compute the θ corresponding to the spline parameter u: u θ = y(u)

Outline Process of keyframing Key frame interpolation Hermite and bezier curve Splines Speed control

Spline parameterization The spline is parameterized by u (0<=u<=1) and not by time t.

Spline parameterization The spline is parameterized by u (0<=u<=1) and not by time t. Hard to deal with the questions like -What is the location of point p at time t -What is the velocity of point p at time t -What is the acceleration of point p at time t

Spline parameterization Solution: reparameterize the curve in terms of t - express spline as a function of the arc length s: u=g(s) - express the arc length s as a function of t: s=f(t)

Speed control Time warping function to control speed - positive - monotonic; you cannot reverse the time s=f(t)

Speed control Simplest form is to have constant velocity along the path s=f(t)

Speed control Assume that the motion slows down at the beginning and end of the motion curve s=f(t)

Arc-length reparameterization Now we want a way to find u given a particular arclength s: u=g(f(t)) Not possible analytically for most curves (e.g. B- splines)

Finite difference Sample the curve at small intervals of the parameter and determine the distance between samples Use theses distances to build a table of arclength for this particular curve: (u i,s i ) What’s parametric value for the arc length.08?

Finite difference Sample the curve at small intervals of the parameter and determine the distance between samples Use theses distances to build a table of arclength for this particular curve: (u i,s i )

Sample the curve at small intervals of the parameter and determine the distance between samples Use theses distances to build a table of arclength for this particular curve: (u i,s i ) Finite difference What’s parametric value for the arc length.08?

Finite difference Sample the curve at small intervals of the parameter and determine the distance between samples Use theses distances to build a table of arclength for this particular curve: (u i,s i ) What’s parametric value for the arc length.08?

Finite difference Sample the curve at small intervals of the parameter and determine the distance between samples Use theses distances to build a table of arclength for this particular curve: (u i,s i ) What’s parametric value for the arc length.05? A linear interpolation of 0.00 and 0.05

Speed control recipe Given a time t, lookup the corresponding arclength S in the speed curve For S, look up the corresponding value of u in the reparameterization table Evaluate the curve at u to obtain the correct interpolated position for the animated object for the given time t