Unformatted text preview:

University of Texas at Austin CS384G - Computer Graphics Spring 2010 Don FussellInterpolating curvesUniversity of Texas at Austin CS384G - Computer Graphics Spring 2010 Don Fussell 2ReadingOptionalBartels, Beatty, and Barsky. An Introduction toSplines for use in Computer Graphics andGeometric Modeling, 1987. (See coursereader.)University of Texas at Austin CS384G - Computer Graphics Spring 2010 Don FussellParametric curve reviewUniversity of Texas at Austin CS384G - Computer Graphics Spring 2010 Don Fussell 4Parametric curvesWe use parametric curves, Q(u)=(x(u),y(u)),where x(u) and y(u) are cubic polynomials:Advantages:easy (and efficient) to compute“well behaved”infinitely differentiableWe also assume that u varies from 0 to 1HGuFuEuuyDCuBuAuux+++=+++=2323)()())0(),0(( yx))1(),1(( yxUniversity of Texas at Austin CS384G - Computer Graphics Spring 2010 Don Fussell 5Various ways to set A,B,C,D0) Directly – non-intuitive; not very useful.1) Set positions and derivatives of endpoints: “Hermite Curve”2) Use “control points” that indirectly influence the curve: “Bezier curve”: - interpolates endpoints - does not interpolate middle control points “B-spline” - does not interpolate ANY control pointsDCuBuAuux +++=23)(University of Texas at Austin CS384G - Computer Graphics Spring 2010 Don Fussell 6Splines = join cubic curvesConsiderationsWhat kind of continuity at join points (“knots”)?C0 = valueC1 = first derivativeC2 = second derivativeHow do control points work?B-splineUniversity of Texas at Austin CS384G - Computer Graphics Spring 2010 Don Fussell 7Spline summaryJoined Hermite curves:C1 continuityInterpolates control pointsB-splines:C2 continuityDoes not interpolate control pointsCan we get…C2 continuityInterpolates control pointsThat’s what we’ll talk about towardsthe end of this lecture.But first, some other useful tips.University of Texas at Austin CS384G - Computer Graphics Spring 2010 Don FussellUseful tips for Bézier curvesUniversity of Texas at Austin CS384G - Computer Graphics Spring 2010 Don Fussell 9Displaying Bézier curvesHow could we draw one of these things?It would be nice if we had an adaptive algorithm, thatwould take into account flatness.DisplayBezier( V0, V1, V2, V3 )begin if ( FlatEnough( V0, V1, V2, V3 ) ) Line( V0, V3 ); else something;end;University of Texas at Austin CS384G - Computer Graphics Spring 2010 Don Fussell 10Subdivide and conquerDisplayBezier( V0, V1, V2, V3 )begin if ( FlatEnough( V0, V1, V2, V3 ) ) Line( V0, V3 ); else Subdivide(V[]) ⇒ L[], R[] DisplayBezier( L0, L1, L2, L3 ); DisplayBezier( R0, R1, R2, R3 );end;University of Texas at Austin CS384G - Computer Graphics Spring 2010 Don Fussell 11Testing for flatnessCompare total length of control polygon tolength of line connecting endpoints:! V0" V1+ V1" V2+ V2" V3V0" V3< 1+#University of Texas at Austin CS384G - Computer Graphics Spring 2010 Don FussellTips for B-splinesB-spline:- C2 continuity- does not interpolate any ctrl pointsUniversity of Texas at Austin CS384G - Computer Graphics Spring 2010 Don Fussell 13Endpoints of B-splinesWe can see that B-splines don’t interpolate the controlpoints.It would be nice if we could at least control the endpointsof the splines explicitly.There’s a trick to make the spline begin and end at controlpoints by repeating them.In the example below, let’s force interpolation of the lastendpoint: (use endpoint 3 times)University of Texas at Austin CS384G - Computer Graphics Spring 2010 Don FussellTips for animator projectUniversity of Texas at Austin CS384G - Computer Graphics Spring 2010 Don Fussell 15What if we want a closed curve, i.e., a loop?With Catmull-Rom and B-spline curves,this is easy:Closing the loopUniversity of Texas at Austin CS384G - Computer Graphics Spring 2010 Don FussellC2 interpolating curvesUniversity of Texas at Austin CS384G - Computer Graphics Spring 2010 Don Fussell 17Simple interpolating splinesJoin several Hermite curves:- Make derivatives match- You still have ability to pick what that matched derivative is.University of Texas at Austin CS384G - Computer Graphics Spring 2010 Don Fussell 18Cardinal splinesIf we set each derivative to be some positive scalar multiple k of thevector between the previous and next controls, we get a Cardinalspline.This leads to:for any two consecutive interior points pi and pi+1 (we can deal withthe endpoints separately if need be)Think of τ as a parameter that controls the tension of the spline! piu="(pi+1# pi#1)pi+1u="(pi+2# pi)τ(p2-p0)τ(p3-p1)τ(p4-p2)University of Texas at Austin CS384G - Computer Graphics Spring 2010 Don Fussell 19Cardinal splines! p(u) = u3u2u 1[ ]2 "2 1 1"3 3 "2 "10 0 1 01 0 0 0# $ % % % % & ' ( ( ( ( pipi+1piupi+1u# $ % % % % & ' ( ( ( ( = u3u2u 1[ ]2 "2 1 1"3 3 "2 "10 0 1 01 0 0 0# $ % % % % & ' ( ( ( ( pipi+1)pi+1" pi"1( ))pi+2" pi( )# $ % % % % & ' ( ( ( ( = u3u2u 1[ ]2 "2 1 1"3 3 "2 "10 0 1 01 0 0 0# $ % % % % & ' ( ( ( ( 0 1 0 00 0 1 0")0)00 ")0)# $ % % % % & ' ( ( ( ( pi"1pipi+1pi+2# $ % % % % & ' ( ( ( ( = u3u2u 1[ ])"1 2 /)"1 "2 /)+ 1 12 "3/)+ 1 3/)" 2 "1"1 0 1 00 1/)0 0# $ % % % % & ' ( ( ( ( pi"1pipi+1pi+2# $ % % % % & ' ( ( ( (University of Texas at Austin CS384G - Computer Graphics Spring 2010 Don Fussell 20Catmull-Rom splinesIf we set τ = 1/2, we get a Catmull-Rom spline.So:for any two consecutive interior points pi and pi+1 (again dealing withendpoints separately as needed)! p(u) = u3u2u 1[ ]"#1 2 /"#1 #2 /"+ 1 12 #3/"+ 1 3/"# 2 #1#1 0 1 00 1/"0 0$ % & & & & ' ( ) ) ) ) pi#1pipi+1pi+2$ % & & & & ' ( ) ) ) ) = u3u2u 1[ ]12#1 3 #3 12 #5 4 #1#1 0 1 00 2 0 0$ % & & & & ' ( ) ) ) ) pi#1pipi+1pi+2$ % & & & & ' ( ) ) ) )University of Texas at Austin CS384G - Computer Graphics Spring 2010 Don Fussell 21Catmull-Rom blending functionsUniversity of Texas at Austin CS384G - Computer Graphics Spring 2010 Don Fussell 22C2 interpolating splinesHow can we keep the C2 continuity we get with B-splinesbut get interpolation, too?Again start with connected cubic curves.Each cubic segment is an Hermite curve for which we getto set the position and


View Full Document

UT CS 384G - Interpolating curves

Documents in this Course
Shading

Shading

27 pages

Shading

Shading

27 pages

Load more
Download Interpolating curves
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Interpolating curves and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Interpolating curves 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?