# Slide 127 October 1999CS 318 - Computer Graphics (Top Changwatchai) Review of Spline Concepts Sections 10-6 to 10-13 in Hearn & Baker Splines can be 2D.

## Presentation on theme: "Slide 127 October 1999CS 318 - Computer Graphics (Top Changwatchai) Review of Spline Concepts Sections 10-6 to 10-13 in Hearn & Baker Splines can be 2D."— Presentation transcript:

Slide 127 October 1999CS 318 - Computer Graphics (Top Changwatchai) Review of Spline Concepts Sections 10-6 to 10-13 in Hearn & Baker Splines can be 2D or 3D Control points Interpolation vs. approximation Convex hull Continuity conditions Local vs. global control Three methods of specifying splines Types of splines –Cubic –Bézier –B-splines –Other

Slide 227 October 1999CS 318 - Computer Graphics (Top Changwatchai) Spline Basics (1/3) Definitions –Textbook calls a spline curve “any composite curve formed with polynomial sections satisfying specified continuity conditions at the boundary of the pieces” - can be 2D or 3D –Spline surfaces formed from two sets of orthogonal spline curves –From now on “spline” refers to spline curve Control points –Used to specify spline curves –Two ways to fit splines Interpolation - curve passes through each control point Approximation - curve does not necessarily pass through any control point Convex hull –minimum convex polygon boundary that encloses set of control points

Slide 327 October 1999CS 318 - Computer Graphics (Top Changwatchai) Spline Basics (2/3) Splines are specified using parametric equations –P(u) = [ x(u) y(u) z(u) ]- row vector –P(u) = Au 3 + Bu 2 + Cu + D- each of A, B, C, and D are row vectors –From now on, we treat P as scalar: P(u) = au 3 + bu 2 + cu + d –Unless otherwise specified, all derivatives are with respect to parameter u Continuity conditions (between two curve sections) –parametric C 0 - same point C 1 - tangent lines (1 st derivatives) equal C 2 - 1 st and 2 nd derivatives equal etc –geometric G 0 = C 0 parametric derivatives proportional (in same direction) but not necessarily equal: –G 1, G 2, etc –note there exists a case where you can have G 1 continuity without C 1 continuity Local vs. global control –Global control - if one point altered, the entire curve affected –Local control - only that curve section is affected

Slide 427 October 1999CS 318 - Computer Graphics (Top Changwatchai) Spline Basics (3/3) Recall from previous slide –P(u) = au 3 + bu 2 + cu + d We can write as: –P(u)= U  CoU = [ u 3 u 2 u 1 ]Co = [ a b c d ] T = U  M spline  M geom = B  M geom –U is the 1  4 parameter vector –Co is the 4  1 coefficient matrix Three methods of spline specification –Boundary conditions Description given in English Actual values placed in 4  1 geometry vector M geom –Basis matrix M spline is the 4  4 basis matrix This is constant for a given type of spline Co = M spline  M geom –Blending functions B is a 1  4 matrix representing the blending functions B = U  M spline = [ F 0 (u) F 1 (u) F 2 (u) F 3 (u) ]

Slide 527 October 1999CS 318 - Computer Graphics (Top Changwatchai) Types of Splines Why cubic? –Higher order less stable, more complex to calculate –Lower order don’t look as good –Cubic is smallest that specifies endpoints and derivatives, and which is nonplanar in 3D Cubic splines (interpolation) –Natural –Hermite –Cardinal –Kochanek-Bartels Bézier (approximation) B-splines (approximation) Other

Slide 627 October 1999CS 318 - Computer Graphics (Top Changwatchai) Review of Cubic Splines Features –Cubic splines interpolate - passes through every control point –We fit one curve section at a time between each pair of successive control points (u=0 to u=1) –We have 4 coefficients (cubic) so for n curve sections need 4n boundary conditions Natural –Boundary conditions: endpoints on control points, 1st and 2nd parametric derivatives match between adjacent curve sections –Bad: exhibits global control Hermite –Boundary conditions: endpoints on control points, parametric slope specified at control points –Exhibits local control, but may be inconvenient to specify slopes Cardinal –Same as Hermite, but we compute tangents from neighboring control points –Has tension parameter t Kochanek-Bartels –Same as cardinal but adds two additional parameters, bias and continuity –Good for modelling abrupt changes

Slide 727 October 1999CS 318 - Computer Graphics (Top Changwatchai) Bézier Curves - Features Approximation Global control Number of control points determines degree of Bézier curve Easy to implement and calculate recursively Always passes through first and last control points Lies within convex hull Easy to connect sections together

Slide 827 October 1999CS 318 - Computer Graphics (Top Changwatchai) Note from 27 October lecture In class we went over how to derive the following boundary conditions from the definition of Bézier curve: P(0) = p 0 P(1) = p n P'(0) = -np 0 + np 1 P'(1) = -np n-1 + np n Dr. Chawla points out that there is a simpler (though equivalent) way to view our derivation: For u = 0, we see that every term except the first has a u and therefore goes to 0. For u = 1, we see that every term except the last has a (1-u) and therefore goes to 0. So we have: Taking the parametric derivative, we get: For u = 0, we see that all terms except the first two have u’s and therefore go to 0. For u = 1, we see that all terms except the last two have (1-u)’s and therefore go to 0. So we have:

Download ppt "Slide 127 October 1999CS 318 - Computer Graphics (Top Changwatchai) Review of Spline Concepts Sections 10-6 to 10-13 in Hearn & Baker Splines can be 2D."

Similar presentations