Parametric Curves & SurfacesOverviewCurvesMany applications in graphicsGoalsParametric curvesParametric polynomial curvesPiecewise parametric polynomialsBézier curvesBasic properties of Bézier curvesExplicit formulationMore propertiesCubic curvesMatrix formDisplaySlide 16FlatnessSplinesCatmull-Rom splinesCatmull-Rom SplinesMatrix formulationPropertiesB-splinesMatrix formulation for B-splinesCurved SurfacesSlide 26Curved Surface RepresentationsSlide 28Parametric SurfacesSurface of revolutionSwept surfaceSlide 32Piecewise Parametric SurfacesParametric PatchesSlide 35Parametric Bicubic PatchesB-Spline PatchesBezier PatchesBezier PatchesBezier SurfacesSlide 41Slide 42Drawing Bezier SurfacesSlide 44Slide 45Slide 46Blender (www.blender.nl)Greg HumphreysCS445: Intro GraphicsUniversity of Virginia, Fall 2003ParametricCurves & SurfacesGreg HumphreysUniversity of VirginiaCS 445, Spring 2002OverviewPart 1: CurvesPart 2: SurfacesPrzemyslaw PrusinkiewiczCurves•Splines: mathematical way to express curves•Motivated by “loftsman’s spline”Long, narrow strip of wood/plasticUsed to fit curves through specified data pointsShaped by lead weights called “ducks”Gives curves that are “smooth” or “fair”•Have been used to design:AutomobilesShip hullsAircraft fuselage/wingMany applications in graphics•Fonts ABC•Animation paths•Shape modeling•etc…Animation(Angel, Plate 1)Shell(Douglas Turnbull, CS 426, Fall99)Goals•Some attributes we might like to have:Predictable controlMultiple valuesLocal controlVersatilityContinuity•We’ll satisfy these goals using:PiecewiseParametricPolynomialsParametric curvesA 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 uy = r sin uIn contrast, an implicit representation is:x2 + y2 = r2Parametric polynomial curves•A parametric polynomial curve is described:•Advantages of polynomial curvesEasy to computeInfinitely differentiableniiiuaux0)(niiiubuy0)(Piecewise parametric polynomials•Use different polynomial functionson different parts of the curveProvides flexibilityHow do you guarantee smoothness at “joints”? (continuity)•In the rest of this lecture, we’ll look at:Bézier curves: general class of polynomial curvesSplines: ways of putting these curves togetherBézier curves•Developed independently in 1960s byBézier (at Renault) deCasteljau (at Citroen)•Curve Q(u) is defined by nested interpolation:Vi’s are control points{V0, V1, …, Vn} is control polygonV0V1V2V3Q(u)Basic properties of Bézier curves•Endpoint interpolation:•Convex hull: Curve is contained within convex hull of control polygon•Symmetry0)0( VQ nVQ )1(},...,{by defined )1( },...,{by defined )(00VVuQVVuQnnExplicit formulation•Let’s indicate level of nesting with superscript j:•An explicit formulation of Q(u) is given by:•Case n=2 (quadratic):111)1(jijijiuVVuV0220100202010100111020)1(2)1( ])1[(])1)[(1( )1( )(VuVuuVuuVVuuuVVuuuVVuVuQMore properties•General case: Bernstein polynomials•Degree: polynomial of degree n•Tangents:)()1(')()0('101nnVVnQVVnQininiiuuinVuQ)1( )(0Cubic 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 doSpecified by points and tangentsAllows specification of a curve in space•All these ideas generalize to higher-order curvesMatrix formBézier curves may be described in matrix form: 321023332212030 0001003303631331 1)1(3)1(3)1()1( )(VVVVuuuVuVuuVuuVuuuinVuQininiiMBezierDisplayQ: How would you draw it using line segments?A: Recursive subdivision!V0V1V2V3DisplayPseudocode for displaying Bézier curves:procedure Display({Vi}):if {Vi} flat within thenoutput line segment V0Vnelsesubdivide to produce {Li} and {Ri}Display({Li})Display({Ri})end ifend procedureFlatnessQ: How do you test for flatness?A: Compare the length of the control polygon to the length of the segment between endpoints1||||||||03231201VVVVVVVVV0V1V2V3(…or, compare dot products…)Splines•For more complex curves, piece together Béziers•We want continuity across joints:Positional (C0) continuityDerivative (C1) 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 wigglesCatmull-Rom splines•PropertiesInterpolate control pointsHave C0 and C1 continuity•DerivationStart with joints to interpolateBuild cubic Bézier between each jointEndpoints of Bézier curves are obvious•What should we do for the other Bézier control points?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 vectorGives a “tension” control Could be adjusted for each jointMatrix formulationConvert from Catmull-Rom CP’s to Bezier CP’s:Exercise: Derive this matrix.32103210 0600161001610060 61VVVVBBBBProperties•Catmull-Rom splines have these attributes:C1 continuityInterpolationLocality of controlNo convex hull property(Proof left as an exercise.)B-splines•We still want local control•Now we want C2 continuity•Give up interpolation•It turns out we get convex hull property•Constraints:Three continuity conditions at each joint j»Position of two curves same»Derivative of two curves same»Second derivatives sameLocal control»Each joint affected by 4 CPsMatrix formulation for B-splines•Grind through some messy math to get: 321023 0141030303631331 611)(VVVVuuuuQCurved Surfaces•MotivationExact boundary representation for some objectsMore concise representation than polygonal
View Full Document