![]() If you need to tessellate something else, you may reuse your tessellation object. (If you don't have to recalculate the tessellation over and over again, using display lists is more efficient.) If the data for the object is static, encapsulate the tessellated polygons in a display list. The most important property is the winding rule, which determines the regions that should be filled and those that should remain unshaded.Ĭreate and render tessellated polygons by specifying the contours of one or more closed polygons. Specify tessellation properties by calling gluTessProperty(). The trickiest case for a callback function is when the tessellation algorithm detects an intersection and must call the function registered for the GLU_TESS_COMBINE callback. Use gluTessCallback() several times to register callback functions to perform operations during the tessellation. If you think a polygon may need tessellation, follow these typical steps.Ĭreate a new tessellation object with gluNewTess(). These routines take as input arbitrary contours, which describe hard-to-render polygons, and they return some combination of triangles, triangle meshes, triangle fans, or lines.įigure 11-1 shows some contours of polygons that require tessellation: from left to right, a concave polygon, a polygon with a hole, and a self-intersecting polygon.įigure 11-1 : Contours That Require Tessellation Such subdivision is called tessellation, and the GLU provides a collection of routines that perform tessellation. ![]() If your application requires the display of concave polygons, polygons containing holes, or polygons with intersecting edges, those polygons must first be subdivided into simple convex polygons before they can be displayed. A polygon is simple if the edges intersect only at vertices, there are no duplicate vertices, and exactly two edges meet at any vertex. ![]() "Quadrics: Rendering Spheres, Cylinders, and Disks" describes how to generate spheres, cylinders, circles and arcs, including data such as surface normals and texture coordinates.Īs discussed in "Describing Points, Lines, and Polygons" in Chapter 2, OpenGL can directly display only simple convex polygons."Polygon Tessellation" explains how to tessellate convex polygons into easier-to-render convex polygons.This chapter has the following major sections. Where the basic OpenGL operates upon simple primitives, such as points, lines, and filled polygons, the GLU can create higher-level objects, such as the surfaces of spheres, cylinders, and cones. To optimize performance, the basic OpenGL only renders convex polygons, but the GLU contains routines to tessellate concave polygons into convex ones, which the basic OpenGL can handle. Only two GLU topics remain: polygon tessellators and quadric surfaces, and those topics are discussed in this chapter. The GLU NURBS facilities, which are built atop OpenGL evaluators, are covered in Chapter 12. The use of gluPickMatrix() is explained in Chapter 13. Several matrix transformation GLU routines ( gluOrtho2D(), gluPerspective(), gluLookAt(), gluProject(), and gluUnProject()) are described in Chapter 3. Mipmapping ( gluBuild*DMipmaps()) and image scaling ( gluScaleImage()) are discussed along with other facets of texture mapping in Chapter 9. Some of the GLU operations are covered in other chapters. The OpenGL Utility Library (GLU) complements the OpenGL library, supporting higher-level operations. The OpenGL library (GL) is designed for low-level operations, both streamlined and accessible to hardware acceleration. Use the GLU library to create quadrics objects to render and model the surfaces of spheres and cylinders and to tessellate disks (circles) and partial disks (arcs).Render concave filled polygons by first tessellating them into convex polygons, which can be rendered using standard OpenGL routines. ![]() After reading this chapter, you'll be able to do the following: ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |