Download presentation

Presentation is loading. Please wait.

Published byFelipe Fowler Modified about 1 year ago

1
Computer Graphics Inf4/MSc Computer Graphics Lecture Notes #11 Curves and Surfaces II

2
Computer Graphics Inf4/MSc 26/10/2007Lecture Notes #112 Uniform Non-rational B-Splines. For each i 4, there is a knot between Q i-1 and Q i at t = t i. Initial points at t 3 and t m+1 are also knots. The following illustrates an example with control points set P 0 … P 9 : Knot. Control point. m=9 (10 control points) m-1 knots m-2 knot intervals.

3
Computer Graphics Inf4/MSc 26/10/2007Lecture Notes #113 Uniform Non-rational B-Splines. First segment Q 3 is defined by point P 0 through P 3 over the range t 3 = 0 to t 4 = 1. So m at least 3 for cubic spline. Knot. Control point. P1 P2 P3 P0 Q3Q3 m=9 (10 control points) m-1 knots m-2 knot intervals.

4
Computer Graphics Inf4/MSc 26/10/2007Lecture Notes #114 Uniform Non-rational B-Splines. Second segment Q 4 is defined by point P 1 through P 4 over the range t 4 = 1 to t 5 = 2. Knot. Control point. Q4Q4 P1 P3 P4 P2 m=9 (10 control points) m-1 knots m-2 knot intervals.

5
Computer Graphics Inf4/MSc 26/10/2007Lecture Notes #115 Uniform Non-Rational B-Splines The unweighted spline set will look as follows, 10 control points, 10 splines, but only 8 knots and 7 knot intervals. You can see why t 3 to t 4 is the first interval with a curve since it is the first with all four B-Spline functions. t 9 to t 10 is the last interval, t 3 to t m+1 are the knots. 43 t 86m m+1 0

6
Computer Graphics Inf4/MSc 26/10/2007Lecture Notes #116 Cubic B-Splines We have talked about a bi-infinite set of splines. What does this look like? The unweighted B-Splines are shown for clarity. How does a weighted set affect the shape of the curve? t 4812

7
Computer Graphics Inf4/MSc 26/10/2007Lecture Notes #117 Generating a curve X(t) t t Opposite we see an example of a shape to be generated. Here we see the curve again with the weighted B-Splines which generated the required shape.

8
Computer Graphics Inf4/MSc 26/10/2007Lecture Notes #118 B-Spline example A closed curve is rather like a bi-infinite set – a periodic set of N knots in which: for all i, t i+N = t i and t i = i for i = 0..N-1 Consider a closed curve with 5 control points with 5 knots. N=5, ie. x –1 x 4, etc. Control points are: x 0 = (2,0); x 1 = (1,1); x 2 = (-1,1); x 3 = (-1,-1) and x 4 = (1,-1).

9
Computer Graphics Inf4/MSc 26/10/2007Lecture Notes #119 B-Spline example Draw the interval: t = [4..5], the others are handled the same way. x0x0 x1x1 x2x2 x3x3 x4x4 x4x4 x1x1

10
Computer Graphics Inf4/MSc 26/10/2007Lecture Notes #1110 How smooth is a B-Spine? Smoothness increases with order k in B i,k –Quadratic, k = 3, gives up to C 1 order continuity. –Cubic, k = 4 gives up to C 2 order continuity. However, we can lower continuity order too with Multiple Knots, ie. t i = t i+1 = t i+2 = … Knots are coincident and so now we have non-uniform knot intervals. A knot with multiplicity m is continuous to the (k-1-m)th derivative. A knot with multiplicity k has no continuity at all, ie. the curve is broken at that knot.

11
Computer Graphics Inf4/MSc 26/10/2007Lecture Notes #1111 Non-Uniform Non-Rational B-Splines Note: as m increases by 1, an extra B-Spline function is attached to that knot: q i B i,k B-Splines have special forms at multiple knots. Obtained from a recursive formula defining how B-Splines are built, by setting m successive knots to be equal: t k+1 = t k+2 = … = t k+m No point in having m>k Thus for endpoints to be on curve, they must have a multiplicity of k, multiplicity of 4 in cubic case.

12
Computer Graphics Inf4/MSc 26/10/2007Lecture Notes #1112 B-Splines at multiple knots The multiple-knot B-Splines are as follows: t B 3,4 (t) B 0,4 (t) B 1,4 (t) B 2,4 (t) i=0,1,2, B 0,4 is totally discontinuous at t = t 0, B 1,4 is position continuous, B 2,4 is gradient continuous, B 3,4 is curvature continuous.

13
Computer Graphics Inf4/MSc 26/10/2007Lecture Notes #1113 B-Spline continuity example. First knot shown with 4 control points, and their convex hull. P1 P2 P0 P3

14
Computer Graphics Inf4/MSc 26/10/2007Lecture Notes #1114 B-Spline continuity example. First two curve segments shown with their respective convex hulls. Centre Knot must lie in the intersection of the 2 convex hulls. P1 P2 P0 P4 P3

15
Computer Graphics Inf4/MSc 26/10/2007Lecture Notes #1115 Repeated control point. First two curve segments shown with their respective convex hulls. Knot is forced to lie on the line that joins the 2 convex hulls. Curve is only C 1 continuous P1=P2 P0 P3 P4

16
Computer Graphics Inf4/MSc 26/10/2007Lecture Notes #1116 Triple control point. First two curve segments shown with their respective convex hulls. Both convex hulls collapse to straight lines – all the curve must lie on these lines. Curve is only C 0 continuous (Curiously it is actually C 2 continuous because tangent vector magnitude falls to zero at join. ) P1=P2=P3 P0 P4

17
Computer Graphics Inf4/MSc 26/10/2007Lecture Notes #1117 Non-uniform non-rational B-splines. Parametric interval between knots does not have to be equal. Blending functions no longer the same for each interval. Multiple knots may have to be spaced apart. Advantages –Continuity at selected control points can be reduced to C 1 or lower – allows us to interpolate a control point without side-effects. –Can interpolate start and end points. –Easy to add extra knots and control points.

18
Computer Graphics Inf4/MSc 26/10/2007Lecture Notes #1118 Summary of B-Splines. Functions that can interpolate a series of control points with C 2 continuity and local control. Don’t pass through their control points, although can be forced. –note that if an order k B-Spline has k points locally colinear then a straight-line section will result midway in the set, and will touch (tangentially) the convex hull for (k – 1) colinear control points. Uniform –Knots are equally spaced in t. Non-Uniform –Knots are unequally spaced –Allows addition of extra control points anywhere in the set.

19
Computer Graphics Inf4/MSc 26/10/2007Lecture Notes #1119 Summary cont. For interactive curve modelling –B-Splines are very good. To interpolate a number of positions –Catmull-Rom splines are best. To interpolate with tangent control –Hemite or Bézier forms are useful and most often used. To draw a spline. –Brute force method : Evaluate matrix to get parametric expressions for coordinates. Then for small increments of t, join with line segments. –Better : use method of forward differences to express spline in t form.

20
Computer Graphics Inf4/MSc 26/10/2007Lecture Notes #1120 Surfaces – a simple extension Easy to generalise from cubic curves to bicubic surfaces. Surfaces defined by parametric equations of two variables, s and t. ie. a surface is approximated by a series of crossing parametric cubic curves Result is a polygon mesh and decreasing step size in s and t will give a mesh of small near-planar quadrilateral patches and more accuracy.

21
Computer Graphics Inf4/MSc 26/10/2007Lecture Notes #1121 Example Bézier surface

22
Computer Graphics Inf4/MSc 26/10/2007Lecture Notes #1122 Control of surface shape Control is now a 2D array of control points. The two parameter surface function, forming the tensor product with the blending functions is: Use appropriate blending functions for Bézier and B-Spline surface functions. Convex Hull property is preserved since bicubic is still a weighted sum (1).

23
Computer Graphics Inf4/MSc 26/10/2007Lecture Notes #1123 Bézier example Matrix formulation is as follows: Substitute suitable values for s and t (20 in the above ex.)

24
Computer Graphics Inf4/MSc 26/10/2007Lecture Notes #1124 B-Spline surfaces Break surface into 4-sided patches choosing suitable values for s and t. Points on any external edges must be multiple knots of multiplicity k. Lot more work than Bézier. There are other types of spline systems and NURBS modelling packages are available to make the work much easier. Use polygon packages for display, hidden-surface removal and rendering. (Bézier too)

25
Computer Graphics Inf4/MSc 26/10/2007Lecture Notes #1125 Continuity of Bicubic patches. Hermite and Bézier patches –C 0 continuity by sharing 4 control points between patches. –C 1 continuity when both sets of control points either side of the edge are collinear with the edge. B-Spline patch. –C 2 continuity between patches.

26
Computer Graphics Inf4/MSc 26/10/2007Lecture Notes #1126 Displaying Bicubic patches. Can calculate surface normals to bicubic surfaces by vector cross product of the 2 tangent vectors. Normal is expensive to compute –Formulation of normal is a biquintic (two-variable,fifth- degree) polynomial. Display. –Can use brute-force method – very expensive ! –Forward differencing method very attractive.

27
Computer Graphics Inf4/MSc 26/10/2007Lecture Notes #1127 Reading for this lecture Foley at al., Chapter 11, sections , , , , 11.3 and Introductory text, Chapter 9, sections 9.2.4, 9.2.5, 9.2.7, and 9.3. Other texts: look for B-Splines UNRBS, NUNRBS, something on forward difference method, comparison of systems, and Bézier and B-Spline surface modelling.

Similar presentations

© 2016 SlidePlayer.com Inc.

All rights reserved.

Ads by Google