![]() ![]() GluTessVertex() specifies a vertex of a contour. Void gluTessVertex(GLUtessellator *tess, GLdouble cords, void *vertexData) It is the nested block inside gluTessBeginPolygon() and gluTessEndPolygon() block. Each contour must be wrapped within this block, gluTessBeginContour() and gluTessEndContour(). Void gluTessEndContour(GLUtessellator *tess)Ī polygon may have more than one closed contour(closed loop), for example, a polyon with a hole in it has 2 contours, inner and outer contours. Void gluTessBeginContour(GLUtessellator *tess) You must describe non-convex polygon between this block. Instead of using glBegin() and glEnd() block to describe all vertices of a polygon, you need to use tessellator-specific block, gluTessBeginPolygon() and gluTessEndPolygon(). Void gluTessEndPolygon(GLUtessellator *tess) Void gluTessBeginPolygon(GLUtessellator *tess, void *userData) If failed to create one, it returns NULL pointer. GluNewTess() creates a tessellator object and gluDeleteTess() deletes the tessellator object. OpenGL provides a collection of routines to process concave polygons to convex polygons: Finally, once tessellation is done, tessellator calls actual OpenGL commands to render the tessellated polygon through the user-defined callback routines. The basic procedure of tessellation is sending all vertex coordinates of a non-convex polygon to the tessellator instead of sending them directly to OpenGL rendering pipeline, and then tessellating the polygon by the tessellator. The left is 4-side concave polygon, the middle has a hole in it, and the right is self-intersecting contour.ĭownload: tessellation.zip, stencilTess.zip Overview Since OpenGL accepts only convex polygons for rendering, these non-convex polygons must be tessellated before rendering. Tessellation is subdividing concave polygons or polygons with intersecting edges into convex polygons. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |