Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition Chapter 16 Figure 16.1: (a) Bernstein polynomials of degree 3: B0,3(u) = (1 - u)3, B1,3(u) = 3(1 - u)2u, B2,3(u) = 3(1 - u)u2, B3,3(u) = u3 (b) A cubic Bezier curve. Figure 16.2: Mesh of Boris's head (courtesy of Sateesh Malla at www.sateeshmalla.com). Figure 16.3: (a) Function fi defined on [0; 1] has support in [a’, b’] (b) Moving Pi, with associated blending function fi, changes c only between c(a’) and c(b’). Figure 16.4: (a) Parabola (b) Three-part function: one upside-down parabola and two straight. Figure 16.5: The right wing of the parabola f(u) = u2 meeting the straight left half of the x-axis smoothly at the origin. Figure 16.6: Five-part function: three parabolic and two straight parts. Joints are black points. Figure 16.7: Parameter space [0, r] with uniformly-spaced knots. Figure 16.8: First-order B-splines: (a) N0,1 (b) Non-zero parts of Ni,1, 0 ≤ i ≤ r -1, distinguished by alternate blue and black colors. Figure 16.9: Screenshot of bSplines.cpp at first order. Figure 16.10: First-order B-spline approximation – the “curve” consists of its control points. Figure 16.11: First-order B-splines each broken into an up part (dashed) N0i,1 and a down part (dotted) N1i,1. Successive Ni,1's are distinguished by color. Figure 16.12: Non-zero parts of linear B-splines. Each is an inverted V. Successive ones are distinguished by color. The down part in the first knot interval and the up part in the last are discarded. The new (truncated) parameter space is [1, r - 1]. Figure 16.13: Screenshot of bSplines.cpp at second-order. Figure 16.14: Linear B-spline approximation. Figure 16.15: (a) The graphs of the two straight-line multiplying functions for N0,2, one dashed and one dotted (b) The result of the multiplication: the up part N00,2 (dashed) and the down part N10,2 (dotted). Figure 16.16: Linear B-splines each broken into an up (dashed) part N0i,2 and down (dotted) part N1i,2. Successive ones are distinguished by color. Figure 16.17: Adding N00,2 and N11,2 to make N0,3. N0,3 consists of three parts: on [0; 1] it's just N00,2, on [2; 3] it's N11,2, while in the middle, on [1; 2] it is the sum of N00,2 and N11,2. Figure 16.18: Screenshot of bSplines.cpp at third order. Figure 16.19: Non-zero parts of the quadratic B-splines; the four joints of the first one are indicated as points as well. Successive splines are distinguished by color. Figure 16.20: Quadratic B-spline approximation. Figure 16.21: Screenshot of quadraticSplineCurve.cpp. Figure 16.22: The first cubic B-spline function N0,4. Figure 16.23: Screenshot of cubicSplineCurve1.cpp. Figure 16.24: Graphs of the functions on the RHS of Equation (16.28): Ni,m-1 and Ni+1,m-1 and their respective linear multipliers u – ti / ti+m-1 – ti and ti+m – u / ti+m – ti+1. Figure 16.25: Non-zero parts of the first-order B-splines over a non-uniform knot vector. Figure 16.26: Non-zero parts of the linear B-splines over a non-uniform knot vector. Figure 16.27: Screenshots of bSplines.cpp over a non-uniform knot vector with a triple knot at the right end: (a) Quadratic (b) Cubic. Figure 16.28: Screenshot of quadraticSplineCurve.cpp with one double knot and one triple knot. Figure 16.29: (a) Part of a cubic spline curve (b) With a new knot inserted. Figure 16.30: B-spline functions over the knot vector T = {0, 1, 2, 3, 3, 4, 5, …} with a double knot at 3 (distinguished inside a box). Figure 16.31: (a) First-order and (b) linear spline curves over the knot vector T = {0, 1, 2, 3, 3, 4, 5, 6, 7, …}, approximating nine control points arranged alternately in two horizontal rows. The (hollow) control point P3 is the only one missing from the first-order “curve”, which consists of the remaining eight points. The second-order curve is the polyline P0P1 … P8 minus P2P3. Figure 16.32: Screenshots of (a) quadraticSplineCurve.cpp and (b) cubicSplineCurve1.cpp over the knot vector T = {0, 1, 2, 3, 3, 4, 5, 6, 7, …} and approximating nine control points arranged in two horizontal rows. Figure 16.33: Screenshot of cubicSplineCurve1.cpp with a triple knot. Figure 16.34: Screenshots of (a) quadraticSplineCurve.cpp and (b) cubicSplineCurve1.cpp, both with knots repeated at the end to interpolate the first and last control points. Figure 16.35: Constructing the B-spline surface approximating an array of control points by sweeping a B-spline curve. The B-spline curves depicted all interpolate both end control points, which need not always be the case in practice. Figure 16.36: Screenshot of cubicSplineCurve2.cpp. Figure 16.37: Use cubicSplineCurve2.cpp to draw a man and his cat. Figure 16.38: Screenshot of bicubicSplineSurface.cpp. Figure 16.39: Screenshot of bicubicSplineSurfaceLitTextured.cpp. Figure 16.40: The loop c on the parameter space W is mapped to the loop c’ on the surface s by the parametric equations for s. Then s is trimmed by c. Figure 16.41: (a) Screenshot of trimmedBicubicBsplineSurface.cpp (b) The three trimming loops – two polygonal and one B-spline.