42
Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition Chapter 16

Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition

Embed Size (px)

DESCRIPTION

Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition. Chapter 16. Figure 16.1: (a) Bernstein polynomials of degree 3: B 0,3 (u) = (1 - u) 3 , B 1,3 (u) = 3(1 - u) 2 u, B 2,3 (u) = 3(1 - u)u 2 , B 3,3 (u) = u 3 (b) A cubic Bezier curve. Figure 16.2: Mesh of - PowerPoint PPT Presentation

Citation preview

Page 1: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition

Computer Graphics Through OpenGL: From Theory to

Experiments, Second Edition

Chapter 16

Page 2: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition

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.

Page 3: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition

Figure 16.2: Mesh ofBoris's head (courtesy ofSateesh Malla atwww.sateeshmalla.com).

Page 4: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition

Figure 16.3: (a) Function fi defined on [0; 1] has support in [a’, b’] (b) Moving Pi, withassociated blending function fi, changes c only between c(a’) and c(b’).

Page 5: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition

Figure 16.4: (a) Parabola (b) Three-part function: one upside-down parabola and twostraight.

Page 6: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition

Figure 16.5: The rightwing of the parabolaf(u) = u2 meeting thestraight left half of thex-axis smoothly at theorigin.

Page 7: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition

Figure 16.6: Five-part function: three parabolic and two straight parts. Joints areblack points.

Page 8: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition

Figure 16.7: Parameterspace [0, r] withuniformly-spaced knots.

Page 9: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition

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.

Page 10: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition

Figure 16.9: Screenshotof bSplines.cpp at firstorder.

Page 11: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition

Figure 16.10: First-order B-spline approximation – the “curve” consists of its controlpoints.

Page 12: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition

Figure 16.11: First-order B-splines each broken into an up part (dashed) N0

i,1 and a down part (dotted) N1i,1. Successive Ni,1's are distinguished by color.

Page 13: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition

Figure 16.12: Non-zero parts of linear B-splines. Each is an inverted V. Successive onesare distinguished by color. The down part in the first knot interval and the up part inthe last are discarded. The new (truncated) parameter space is [1, r - 1].

Page 14: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition

Figure 16.13: Screenshotof bSplines.cpp atsecond-order.

Page 15: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition

Figure 16.14: Linear B-spline approximation.

Page 16: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition

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 N0

0,2 (dashed) and the down part N10,2 (dotted).

Page 17: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition

Figure 16.16: Linear B-splines each broken into an up (dashed) part N0

i,2 and down (dotted) part N1i,2. Successive ones are distinguished by color.

Page 18: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition

Figure 16.17: Adding N00,2 and N1

1,2 to make N0,3. N0,3 consists of three parts: on [0; 1] it's just N0

0,2, on [2; 3] it's N1

1,2, while in the middle, on [1; 2] it is the sum of N00,2

and N11,2.

Page 19: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition

Figure 16.18: Screenshotof bSplines.cpp at thirdorder.

Page 20: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition

Figure 16.19: Non-zero parts of the quadratic B-splines; the four joints of the first oneare indicated as points as well. Successive splines are distinguished by color.

Page 21: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition

Figure 16.20: Quadratic B-spline approximation.

Page 22: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition

Figure 16.21: Screenshotof quadraticSpline-Curve.cpp.

Page 23: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition

Figure 16.22: The first cubic B-spline function N0,4.

Page 24: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition

Figure 16.23: ScreenshotofcubicSplineCurve1.cpp.

Page 25: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition

Figure 16.24: Graphs of the functions on the RHS of Equation (16.28): N i,m-1 andNi+1,m-1 and their respective linear multipliers u – ti / ti+m-1 – ti

and ti+m – u / ti+m – ti+1.

Page 26: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition

Figure 16.25: Non-zero parts of the first-order B-splines over a non-uniform knotvector.

Page 27: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition

Figure 16.26: Non-zero parts of the linear B-splines over a non-uniform knot vector.

Page 28: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition

Figure 16.27: Screenshots of bSplines.cpp over a non-uniform knot vector with atriple knot at the right end: (a) Quadratic (b) Cubic.

Page 29: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition

Figure 16.28: Screenshotof quadraticSpline-Curve.cpp with one doubleknot and one triple knot.

Page 30: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition

Figure 16.29: (a) Part of a cubic spline curve (b) With a new knot inserted.

Page 31: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition

Figure 16.30: B-spline functions over the knot vector T = {0, 1, 2, 3, 3, 4, 5, …} with adouble knot at 3 (distinguished inside a box).

Page 32: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition

Figure 16.31: (a) First-order and (b) linear spline curves over the knot vectorT = {0, 1, 2, 3, 3, 4, 5, 6, 7, …}, approximating nine control points arranged alternately intwo horizontal rows. The (hollow) control point P3 is the only one missing from thefirst-order “curve”, which consists of the remaining eight points. The second-order curveis the polyline P0P1 … P8 minus P2P3.

Page 33: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition

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, …} andapproximating nine control points arranged in two horizontal rows.

Page 34: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition

Figure 16.33: Screenshotof cubicSplineCurve1.cppwith a triple knot.

Page 35: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition

Figure 16.34: Screenshots of (a) quadraticSplineCurve.cpp and(b) cubicSplineCurve1.cpp, both with knots repeated at the end to interpolate the firstand last control points.

Page 36: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition

Figure 16.35: Constructing the B-spline surface approximating an array of controlpoints by sweeping a B-spline curve. The B-spline curves depicted all interpolate bothend control points, which need not always be the case in practice.

Page 37: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition

Figure 16.36: Screenshotof cubicSplineCurve2.cpp.

Page 38: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition

Figure 16.37: Use cubicSplineCurve2.cpp to draw a man and his cat.

Page 39: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition

Figure 16.38: Screenshotof bicubicSpline-Surface.cpp.

Page 40: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition

Figure 16.39: Screenshotof bicubicSplineSurface-LitTextured.cpp.

Page 41: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition

Figure 16.40: The loop c on the parameter space W is mapped to the loop c’ on thesurface s by the parametric equations for s. Then s is trimmed by c.

Page 42: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition

Figure 16.41: (a) Screenshot of trimmedBicubicBsplineSurface.cpp (b) The threetrimming loops – two polygonal and one B-spline.