Chapter XVII Parametric Curves and Surfaces Introduction to

  • Slides: 27
Download presentation
Chapter XVII Parametric Curves and Surfaces Introduction to Computer Graphics with Open. GL ES

Chapter XVII Parametric Curves and Surfaces Introduction to Computer Graphics with Open. GL ES (J. Han)

Line Segment and Linear Interpolation § A line segment connecting two end points, p

Line Segment and Linear Interpolation § A line segment connecting two end points, p 0 and p 1, is represented in a parametric equation and is considered as linear interpolation of the points. [from Wikipedia] § The line segment may be considered as being divided into two parts by p(t), and the weight for an end point is proportional to the length of the part “on the opposite side, ” i. e. , the weights for p 0 and p 1 are (1 -t) and t, respectively. § The same applies to 3 D. Introduction to Computer Graphics with Open. GL ES (J. Han) 17 -2 2

Quadratic Bézier Curve § de Casteljau algorithm = recursive linear interpolations for defining a

Quadratic Bézier Curve § de Casteljau algorithm = recursive linear interpolations for defining a curve § The quadratic Bézier curve interpolates the end points, p 0 and p 2, and is pulled toward p 1, but does not interpolate it. [from Wikipedia] Introduction to Computer Graphics with Open. GL ES (J. Han) 17 -3 3

Cubic Bézier Curve § The cubic Bézier curve interpolates the end points, p 0

Cubic Bézier Curve § The cubic Bézier curve interpolates the end points, p 0 and p 3, and is pulled toward p 1 and p 2. [from Wikipedia] Introduction to Computer Graphics with Open. GL ES (J. Han) 17 -4 4

Quartic Bézier Curve § The de Casteljau algorithm can be applied for a higher-degree

Quartic Bézier Curve § The de Casteljau algorithm can be applied for a higher-degree Bézier curve. For example, a quartic (degree-4) Bézier curve can be constructed using five points. [from Wikipedia] § Such higher-degree curves often reveal undesired wiggles. Worse still, they do not bring significant advantages. In contrast, quadratic curves have little flexibility. Therefore, cubic Bézier curves are most popularly used in the graphics field. Introduction to Computer Graphics with Open. GL ES (J. Han) 17 -5 5

Bézier Curve – Control Points and Bernstein Polynomials § The points pis are called

Bézier Curve – Control Points and Bernstein Polynomials § The points pis are called control points. A degree-n Bézier curve requires (n+1) control points. The coefficients associated with the control point are polynomials of parameter t, and are named Bernstein polynomials. Introduction to Computer Graphics with Open. GL ES (J. Han) 17 -6 6

Bézier Curve – Control Point Order § Different orders of the control points produce

Bézier Curve – Control Point Order § Different orders of the control points produce different curves. Introduction to Computer Graphics with Open. GL ES (J. Han) 17 -7 7

Bézier Curve – Tessellation for Rendering § The typical method to display a Bézier

Bézier Curve – Tessellation for Rendering § The typical method to display a Bézier curve is to approximate it using a series of line segments. This process is often called tessellation. It evaluates the curve at a fixed set of parameter values, and joins the evaluated points with straight lines. Introduction to Computer Graphics with Open. GL ES (J. Han) 17 -8 8

Bézier Curve – Affine Invariance Introduction to Computer Graphics with Open. GL ES (J.

Bézier Curve – Affine Invariance Introduction to Computer Graphics with Open. GL ES (J. Han) 17 -9 9

Hermite Curve Introduction to Computer Graphics with Open. GL ES (J. Han) 17 -10

Hermite Curve Introduction to Computer Graphics with Open. GL ES (J. Han) 17 -10 10

Catmull-Rom Spline § A spline (piecewise curve) composed of cubic Hermite curves passes through

Catmull-Rom Spline § A spline (piecewise curve) composed of cubic Hermite curves passes through the given points qis. Two adjacent Hermite curves should share the tangent vector at their junction. § The tangent vector at qi is parallel to the vector connecting qi-1 and qi+1. Introduction to Computer Graphics with Open. GL ES (J. Han) 17 -11 11

Application Introduction to Computer Graphics with Open. GL ES (J. Han) 17 -12 12

Application Introduction to Computer Graphics with Open. GL ES (J. Han) 17 -12 12

Application (cont’d) Introduction to Computer Graphics with Open. GL ES (J. Han) 17 -13

Application (cont’d) Introduction to Computer Graphics with Open. GL ES (J. Han) 17 -13 13

Bilinear Patch § Combination of linear interpolations using four control points § Matrix representation

Bilinear Patch § Combination of linear interpolations using four control points § Matrix representation where the center matrix corresponds to the control point net Introduction to Computer Graphics with Open. GL ES (J. Han) 17 -14 14

Bilinear Patch (cont’d) § Tessellation with nested for loops Introduction to Computer Graphics with

Bilinear Patch (cont’d) § Tessellation with nested for loops Introduction to Computer Graphics with Open. GL ES (J. Han) 17 -15 15

Bilinear Patch (cont’d) § Let’s reverse the order of u and v in linear

Bilinear Patch (cont’d) § Let’s reverse the order of u and v in linear interpolations. Introduction to Computer Graphics with Open. GL ES (J. Han) 17 -16 16

Bilinear Patch (cont’d) § The control points are not necessarily in a plane, and

Bilinear Patch (cont’d) § The control points are not necessarily in a plane, and consequently the bilinear patch is not necessarily a plane. Introduction to Computer Graphics with Open. GL ES (J. Han) 17 -17 17

Biquadratic Bézier Patch § A simple extension of bilinear patch Introduction to Computer Graphics

Biquadratic Bézier Patch § A simple extension of bilinear patch Introduction to Computer Graphics with Open. GL ES (J. Han) 17 -18 18

Biquadratic Bézier Patch (cont’d) Introduction to Computer Graphics with Open. GL ES (J. Han)

Biquadratic Bézier Patch (cont’d) Introduction to Computer Graphics with Open. GL ES (J. Han) 17 -19 19

Biquadratic Bézier Patch (cont’d) § Another example Introduction to Computer Graphics with Open. GL

Biquadratic Bézier Patch (cont’d) § Another example Introduction to Computer Graphics with Open. GL ES (J. Han) 17 -20 20

Biquadratic Bézier Patch (cont’d) § So far, a triple of control points defines a

Biquadratic Bézier Patch (cont’d) § So far, a triple of control points defines a curve in the same parameter, and then three such curves are combined in terms of the other parameter. § Now, let’s see repeated bilinear interpolations, which produce the same result. Introduction to Computer Graphics with Open. GL ES (J. Han) 17 -21 21

Bicubic Bézier Patch § A simple extension of biquadratic Bézier patch § We can

Bicubic Bézier Patch § A simple extension of biquadratic Bézier patch § We can of course reverse the order of u and v. Introduction to Computer Graphics with Open. GL ES (J. Han) 17 -22 22

Bicubic Bézier Patch (cont’d) § Let’s apply repeated bilinear interpolations. § Tessellation and rendering

Bicubic Bézier Patch (cont’d) § Let’s apply repeated bilinear interpolations. § Tessellation and rendering result Introduction to Computer Graphics with Open. GL ES (J. Han) 17 -23 23

Shape Control Introduction to Computer Graphics with Open. GL ES (J. Han) 17 -24

Shape Control Introduction to Computer Graphics with Open. GL ES (J. Han) 17 -24 24

Bézier Triangle § Degree-1 Bézier triangle § The weights (u, v, w) are called

Bézier Triangle § Degree-1 Bézier triangle § The weights (u, v, w) are called the barycentric coordinates of p. § The triangle is divided into three sub-triangles, and the weight given for a control point is proportional to the area of the sub-triangle “on the opposite side. ” § Obviously, u+v+w=1, and therefore w can be replaced by (1 -u-v). Introduction to Computer Graphics with Open. GL ES (J. Han) 17 -25 25

Bézier Triangle (cont’d) § Degree-2 Bézier triangle § See what s represents when u=0

Bézier Triangle (cont’d) § Degree-2 Bézier triangle § See what s represents when u=0 and u=1. Introduction to Computer Graphics with Open. GL ES (J. Han) 17 -26 26

Bézier Triangle (cont’d) § Degree-3 Bézier triangle Introduction to Computer Graphics with Open. GL

Bézier Triangle (cont’d) § Degree-3 Bézier triangle Introduction to Computer Graphics with Open. GL ES (J. Han) 17 -27 27