1 / 32

Graphics II 91.547 Parametric Curves and Surfaces

Graphics II 91.547 Parametric Curves and Surfaces. Session 3. Parametric Curves and Surfaces: Key Concepts. Point. Curve, Surface Collection of points. Parametric Representation. (for a curve). Parametric Curves and Surfaces Key Concepts, contd.

adolph
Download Presentation

Graphics II 91.547 Parametric Curves and Surfaces

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Graphics II 91.547Parametric Curvesand Surfaces Session 3

  2. Parametric Curves and Surfaces:Key Concepts Point Curve, Surface Collection of points Parametric Representation (for a curve)

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

  4. Continuity Considerations: C0 & C1 Continuity

  5. How do we insure C0 and C1 continuity?

  6. Bezier Curves: 1. Require interpolation at the endpoints of the curve: 2. Require that the line segments P0 P1 and P3P2 match the first derivative of the curve at 0 and 1.

  7. Calculating the Bezier Geometry Matrix

  8. Calculating the Bezier Geometry Matrix

  9. Bezier Blending Functions This can be expressed: where

  10. Bezier Blending Functions:

  11. Convex Hull Property: Curve must lie within this region known as “convex hull” of the control points.

  12. Further look at the Bezier blending functions: Factoring the blending functions gives: These are an instance of the Bernstein Polynomials for k=3.

  13. Bezier Curves:Code Example 120 goto 120

  14. An interesting geometric construction

  15. Recursive subdivision of Bezier curves

  16. Bezier surface patch Convex hull of patch

  17. Bezier surface patchCorner 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. Connect new control points to form new curves. First subdivide curves of constant v. Rendering the Bezier patch by recursivesubdivision Finally subdivide these curves to form 4 new patches.

  19. Recursive subdivision of Bezier curves

  20. The Utah Teapot: 32 Bezier Patches

  21. Utah Teapot: Polygon Representation

  22. Rendering the Teapot

  23. Conversion between curve representations Given a cubic Bezier curve expressed in terms of the Bezier geometry matrix, MB: 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. 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 matrixMI : where We want to find p such that:

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

  26. 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. One Dimensional Evaluators:target parameter GL_MAP_VERTEX_3 x,y,z vertex coords. GL_MAP_VERTEX_4 x,y,z,w vertex coords GL_MAP1_INDEX color index GL_MAP1_COLOR_4 RGBA GL_MAP2_NORMAL normal coordinates GL_MAP1_TEXTURE_COORD_1 s texture coords. GL_MAP1_TEXTURE_COORD_2 s,t texture coords. GL_MAP1_TEXTURE_COORD_3 s,t,r texture coords. GL_MAP1_TEXTURE_COORD_4 s,t,r,q texture coords.

  28. One Dimensional Evaluators:Code Example 120 goto 120 ?

  29. 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); modeis 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. 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. 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); modeis 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. Two Dimensional Evaluators:Code Examples 120 goto 120

More Related