Presentation is loading. Please wait.

Presentation is loading. Please wait.

19/13/2015 10:20 UML Graphics II 91.547 Parametric Curves and Surfaces Session 3.

Similar presentations


Presentation on theme: "19/13/2015 10:20 UML Graphics II 91.547 Parametric Curves and Surfaces Session 3."— Presentation transcript:

1 19/13/2015 10:20 UML Graphics II 91.547 Parametric Curves and Surfaces Session 3

2 29/13/2015 10:20 UML Parametric Curves and Surfaces: Key Concepts Point Curve, SurfaceCollection of points Parametric Representation (for a curve)

3 39/13/2015 10:20 UML Parametric Curves and Surfaces Key Concepts, contd. Multiplying a point by a scalar:Scaling the representation Polynomial Control Points Set of (degree+1) points that bear some relation to the desired curve or surface Basis Functions Set of (degree + 1) polynomials that, when multiplied by the corresponding control points, produce the curve or surface

4 49/13/2015 10:20 UML Continuity Considerations: C0 & C1 Continuity

5 59/13/2015 10:20 UML How do we insure C 0 and C 1 continuity?

6 69/13/2015 10:20 UML Bezier Curves: 1. Require interpolation at the endpoints of the curve: 2. Require that the line segments P 0 P 1 and P 3 P 2 match the first derivative of the curve at 0 and 1.

7 79/13/2015 10:20 UML Calculating the Bezier Geometry Matrix

8 89/13/2015 10:20 UML Calculating the Bezier Geometry Matrix

9 99/13/2015 10:20 UML Bezier Blending Functions where This can be expressed:

10 109/13/2015 10:20 UML Bezier Blending Functions:

11 119/13/2015 10:20 UML Convex Hull Property: Curve must lie within this region known as “convex hull” of the control points.

12 129/13/2015 10:20 UML Further look at the Bezier blending functions: These are an instance of the Bernstein Polynomials for k=3. Factoring the blending functions gives:

13 139/13/2015 10:20 UML Bezier Curves: Code Example 120 goto 120

14 149/13/2015 10:20 UML An interesting geometric construction

15 159/13/2015 10:20 UML Recursive subdivision of Bezier curves

16 169/13/2015 10:20 UML Bezier surface patch Convex hull of patch

17 179/13/2015 10:20 UML Bezier surface patch Corner boundary conditions Four equations for each corner gives 16 total. Patch must interpolate the corner. Defines derivative in u direction. Defines derivative in v direction. “Twist”

18 189/13/2015 10:20 UML Rendering the Bezier patch by recursive subdivision First subdivide curves of constant v. Connect new control points to form new curves. Finally subdivide these curves to form 4 new patches.

19 199/13/2015 10:20 UML Recursive subdivision of Bezier curves

20 209/13/2015 10:20 UML The Utah Teapot: 32 Bezier Patches

21 219/13/2015 10:20 UML Utah Teapot: Polygon Representation

22 229/13/2015 10:20 UML Rendering the Teapot

23 239/13/2015 10:20 UML Conversion between curve representations Given a cubic Bezier curve expressed in terms of the Bezier geometry matrix, M B : The same curve can be expressed in terms of another polynomial basis with matrix M and matrix of control points q. Solving for q gives:

24 249/13/2015 10:20 UML Conversion between curve representations: an example Suppose you have a matrix of four control points, q and a cubic interpolating those points q(u). The curve is obtained by the interpolating geometry matrix M I : where We want to find p such that:

25 259/13/2015 10:20 UML Drawing Bezier curves and surfaces: Evaluators Evaluator Control Points Parameter Generation glMap1{fd}() glMap2{fd}() glEvalCoord1{fd}() glEvalCoord2{fd}() Parameter(s) Curve/surface value Establish Evaluator: Evaluate Points:

26 269/13/2015 10:20 UML One Dimensional Evaluators Void glMap1{fd](GLenum target, TYPE u1, TYPE u2, Glint stride,Glint order, TYPE *points); target: specifies what the control points represent u1: beginning parameter value u2: end parameter value stride: number of values in each block of control point storage order: order of the Bezier curve (degree+1) *points: pointer to array of control points

27 279/13/2015 10:20 UML One Dimensional Evaluators: target parameter GL_MAP_VERTEX_3x,y,z vertex coords. GL_MAP_VERTEX_4x,y,z,w vertex coords GL_MAP1_INDEXcolor index GL_MAP1_COLOR_4RGBA GL_MAP2_NORMALnormal coordinates GL_MAP1_TEXTURE_COORD_1s texture coords. GL_MAP1_TEXTURE_COORD_2s,t texture coords. GL_MAP1_TEXTURE_COORD_3s,t,r texture coords. GL_MAP1_TEXTURE_COORD_4s,t,r,q texture coords.

28 289/13/2015 10:20 UML One Dimensional Evaluators: Code Example 120 goto 120 ?

29 299/13/2015 10:20 UML Mesh Generation: One Dimensional void glMapGrid1{fd} (Glint n, TYPE u1, TYPE u2); Defines a grid that goes from u1 to u2 in n evenly spaced steps. void glEvalMesh1 (GLenum mode, GLint p1, Glint p2); mode is either GL_POINT or GL_LINE depending on whether you want to draw individual points or connected lines. p1, p2 are the grid values between which the mesh is to be evaluated

30 309/13/2015 10:20 UML Two Dimensional Evaluators Void glMap2{fd](GLenum target, TYPE u1, TYPE u2, Glint ustride,Glint uorder, TYPE v1, TYPE v2, GLint vstride, Glint vorder, TYPE *points); target: specifies what the control points represent u1, v1: beginning parameter value u2, v2: end parameter value stride: number of values in each block of control point storage order: order of the Bezier curve (degree+1) *points: pointer to array of control points

31 319/13/2015 10:20 UML Mesh Generation: Two Dimensional void glMapGrid2{fd} (GLint nu, TYPE u1, TYPE u2 GLint nv, TYPE v1, TYPE v2); Defines a two dimensional grid that goes from u1 to u2 in nu evenly spaced steps and from v1 to v2 in nv evenly spaced steps. void glEvalMesh2 (GLenum mode, GLint p1, GLint p2, GLint q1, GLint q2); mode is either GL_POINT, GL_LINE, or GL_FILL depending on whether you want to draw individual points, connected lines, or a filled mesh. p1, p2, q1, q2 are the grid values between which the mesh is to be evaluated

32 329/13/2015 10:20 UML Two Dimensional Evaluators: Code Examples 120 goto 120


Download ppt "19/13/2015 10:20 UML Graphics II 91.547 Parametric Curves and Surfaces Session 3."

Similar presentations


Ads by Google