Presentation is loading. Please wait.

Presentation is loading. Please wait.

Greg Humphreys CS445: Intro Graphics University of Virginia, Fall 2003 Parametric Curves & Surfaces Greg Humphreys University of Virginia CS 445, Spring.

Similar presentations


Presentation on theme: "Greg Humphreys CS445: Intro Graphics University of Virginia, Fall 2003 Parametric Curves & Surfaces Greg Humphreys University of Virginia CS 445, Spring."— Presentation transcript:

1 Greg Humphreys CS445: Intro Graphics University of Virginia, Fall 2003 Parametric Curves & Surfaces Greg Humphreys University of Virginia CS 445, Spring 2002

2 Overview Today: Curves Next Time: Surfaces Przemyslaw Prusinkiewicz

3 Curves Splines: mathematical way to express curves Motivated by “loftsman’s spline”  Long, narrow strip of wood/plastic  Used to fit curves through specified data points  Shaped by lead weights called “ducks”  Gives curves that are “smooth” or “fair” Have been used to design:  Automobiles  Ship hulls  Aircraft fuselage/wing

4 Many applications in graphics Fonts ABC Animation paths Shape modeling etc… Animation (Angel, Plate 1) Shell (Douglas Turnbull)

5 Goals Some attributes we might like to have:  Predictable control  Local control  Versatility  Continuity We’ll satisfy these goals using:  Piecewise  Parametric  Polynomials

6 Parametric curves A parametric curve in the plane is expressed as: x = x(u) y = y(u) Example: a circle with radius r centered at origin: x = r cos u y = r sin u In contrast, an implicit representation is: x 2 + y 2 = r 2

7 Parametric polynomial curves A parametric polynomial curve is: Advantages of polynomial curves  Easy to compute  Easy differentiation

8 Piecewise parametric polynomials Use different polynomial functions on different parts of the curve  Provides flexibility  How do you guarantee continuity/smoothness at join points (called knots)? In the rest of this lecture, we’ll look at:  Bézier curves: general class of polynomial curves  Splines: ways of putting these curves together

9 Bézier curves Developed independently in 1960s by  Bézier (at Renault)  deCasteljau (at Citroen) Curve Q(u) is defined by nested interpolation: V i ’s are control points { V 0, V 1, …, V n } is control polygon V0V0 V1V1 V2V2 V3V3 Q(u)

10 Basic properties of Bézier curves Endpoint interpolation: Convex hull:  Curve is contained within convex hull of control polygon Transformational invariance Symmetry

11 Explicit formulation Let’s indicate level of nesting with superscript j: An explicit formulation of Q(u) is given by:

12 Explicit formulation Let’s indicate level of nesting with superscript j: An explicit formulation of Q(u) is given by: Case n=2 (quadratic):

13 More properties General case: Bernstein polynomials Degree: polynomial of degree n Tangents:

14 Display Q: How would you draw it using line segments? A: Recursive subdivision! When do you stop? V0V0 V1V1 V2V2 V3V3

15 Flatness Q: How do you test for flatness? A: Compare the length of the control polygon to the length of the segment between endpoints V0V0 V1V1 V2V2 V3V3 (…or, compare dot products…)

16 Cubic curves From now on, let’s talk about cubic curves (n=3) In CAGD, higher-order curves are often used In graphics, piecewise cubic curves will do  Specified by points and tangents  Allows specification of a curve in space All these ideas generalize to higher-order curves

17 Hermite Curves Given: two points and two tangent vectors  Similarity to cubic Bézier curves  Other two Bézier control points along those tangents Call the points P 1 and P 2, and the tangents R 1 and R 2 So given two points and vectors, find the coefficients of and Hermite curves pass through all the points, and they have C 1 continuity

18 Hermite Curves (Cont.) Finding those coefficients is pretty straightforward. Just write down what we know so far:

19 Hermite Curves (Cont.) What’s going on here? Write: Stuff from last slide gives:

20 The Hermite Matrix Put it all into a matrix and invert it to solve!

21 Splines For more complex curves, piece together cubics We want continuity across joints:  Positional (C 0 ) continuity  Derivative (C 1 ) continuity Q: How would you satisfy continuity constraints? Q: Why not just use higher-order Bézier curves? A: Splines have several of advantages: Numerically more stable Easier to compute Fewer bumps and wiggles

22 Catmull-Rom splines Properties  Interpolate control points  Have C 0 and C 1 continuity Derivation  Start with joints to interpolate  Build cubic Bézier between each joint  Endpoints of Bézier curves are obvious What should we do for the other Bézier control points?

23 Catmull-Rom Splines Catmull & Rom use:  half the magnitude of the vector between adjacent CP’s Many other formulations work, for example:  Use an arbitrary constant  times this vector  Gives a “tension” control  Could be adjusted for each joint

24 Properties Catmull-Rom splines have these attributes:  C1 continuity  Interpolation  Locality of control  No convex hull property (Proof left as an exercise.)

25 B-splines We still want local control Now we want C 2 continuity Give up interpolation Constraints:  Three continuity conditions at each joint j »Position of two curves same »Derivative of two curves same »Second derivatives same  Local control »Each joint affected by 4 CPs

26 Matrix formulation for B-splines Grind through some messy math to get:

27 Assignment 6 Demo


Download ppt "Greg Humphreys CS445: Intro Graphics University of Virginia, Fall 2003 Parametric Curves & Surfaces Greg Humphreys University of Virginia CS 445, Spring."

Similar presentations


Ads by Google