Unformatted text preview:

Interpolating curves University of Texas at Austin CS384G Computer Graphics Fall 2010 Don Fussell Reading Optional Bartels Beatty and Barsky An Introduction to Splines for use in Computer Graphics and Geometric Modeling 1987 See course reader University of Texas at Austin CS384G Computer Graphics Fall 2010 Don Fussell 2 Parametric curve review University of Texas at Austin CS384G Computer Graphics Fall 2010 Don Fussell Parametric curves We use parametric curves Q u x u y u where x u and y u are cubic polynomials x u Au 3 Bu 2 Cu D y u Eu 3 Fu 2 Gu H Advantages x 1 y 1 x 0 y 0 easy and efficient to compute well behaved infinitely differentiable We also assume that u varies from 0 to 1 University of Texas at Austin CS384G Computer Graphics Fall 2010 Don Fussell 4 Various ways to set A B C D x u Au 3 Bu 2 Cu D 0 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 points University of Texas at Austin CS384G Computer Graphics Fall 2010 Don Fussell 5 Splines join cubic curves B spline Considerations What kind of continuity at join points knots C0 value C1 first derivative C2 second derivative How do control points work University of Texas at Austin CS384G Computer Graphics Fall 2010 Don Fussell 6 Spline summary Joined Hermite curves C1 continuity Interpolates control points B splines C2 continuity Does not interpolate control points Can we get C2 continuity Interpolates control points That s what we ll talk about towards the end of this lecture But first some other useful tips University of Texas at Austin CS384G Computer Graphics Fall 2010 Don Fussell 7 Useful tips for B zier curves University of Texas at Austin CS384G Computer Graphics Fall 2010 Don Fussell Displaying B zier curves How could we draw one of these things It would be nice if we had an adaptive algorithm that would 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 Fall 2010 Don Fussell 9 Subdivide and conquer DisplayBezier 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 Fall 2010 Don Fussell 10 Testing for flatness Compare total length of control polygon to length of line connecting endpoints V0 V1 V1 V2 V2 V3 1 V0 V3 University of Texas at Austin CS384G Computer Graphics Fall 2010 Don Fussell 11 Tips for B splines B spline C2 continuity does not interpolate any ctrl points University of Texas at Austin CS384G Computer Graphics Fall 2010 Don Fussell Endpoints of B splines We can see that B splines don t interpolate the control points It would be nice if we could at least control the endpoints of the splines explicitly There s a trick to make the spline begin and end at control points by repeating them In the example below let s force interpolation of the last endpoint use endpoint 3 times University of Texas at Austin CS384G Computer Graphics Fall 2010 Don Fussell 13 Tips for animator project University of Texas at Austin CS384G Computer Graphics Fall 2010 Don Fussell Closing the loop What if we want a closed curve i e a loop With Catmull Rom and B spline curves this is easy University of Texas at Austin CS384G Computer Graphics Fall 2010 Don Fussell 15 C2 interpolating curves University of Texas at Austin CS384G Computer Graphics Fall 2010 Don Fussell Simple interpolating splines Join 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 Fall 2010 Don Fussell 17 Cardinal splines If we set each derivative to be some positive scalar multiple k of the vector between the previous and next controls we get a Cardinal spline This leads to p p 2 0 p3 p1 pui p i 1 pi 1 p ui 1 p i 2 p i p4 p2 for any two consecutive interior points pi and pi 1 we can deal with the endpoints separately if need be QuickTime and a decompressor are needed to see this picture Think of as a parameter that controls the tension of the spline University of Texas at Austin CS384G Computer Graphics Fall 2010 Don Fussell 18 Cardinal splines p u u 3 u2 u3 u2 u3 u2 u3 u2 2 2 1 1 pi 3 3 2 1 pi 1 u 1 0 0 1 0 p ui u 1 0 0 0 pi 1 2 2 1 1 pi p 3 3 2 1 i 1 u 1 0 0 1 0 pi 1 pi 1 1 0 0 0 pi 2 pi 2 2 1 1 0 1 0 0 pi 1 3 3 2 1 0 0 1 0 pi u 1 0 0 1 0 0 0 pi 1 1 0 0 0 0 0 pi 2 1 2 1 2 1 1 pi 1 2 3 1 3 2 1 pi u 1 1 0 1 0 pi 1 1 0 0 pi 2 0 University of Texas at Austin CS384G Computer Graphics Fall 2010 Don Fussell 19 Catmull Rom splines If we set 1 2 we get a Catmull Rom spline So p u u 3 u2 1 2 1 2 1 1 pi 1 2 3 1 3 2 1 pi u 3 u 1 1 0 1 0 pi 1 1 0 0 pi 2 0 u2 1 3 3 1 pi 1 1 2 5 4 1 pi u 1 2 1 0 1 0 pi 1 0 2 0 0 pi 2 for any two consecutive interior points pi and pi 1 again dealing with endpoints separately as needed University of Texas at Austin CS384G Computer Graphics Fall 2010 Don Fussell 20 Catmull Rom blending functions QuickTime and a decompressor are needed to see this picture University of Texas at Austin CS384G Computer Graphics Fall 2010 Don Fussell 21 C2 interpolating splines How can we keep the C2 continuity we get with B splines but get interpolation too Again start with connected cubic curves Each cubic segment is an Hermite curve for which we get to set the position and derivative of the endpoints That leaves us with a spline that s C0 and C1 such as a Catmull Rom or Cardinal spline But interestingly there are other ways to choose the values of the shared first derivatives at the join points Is there a way to set those derivatives to get other useful properties University of Texas at Austin CS384G Computer Graphics Fall 2010 Don Fussell 22 Find second derivatives So far we have C0 C1 continuity Derivatives are still free as D 0 D4 Compute …


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?