1GLUTESSVERTEX(3G) OpenGL Manual GLUTESSVERTEX(3G)
2
3
4
6 gluTessVertex - specify a vertex on a polygon
7
9 void gluTessVertex(GLUtesselator* tess, GLdouble * location,
10 GLvoid* data);
11
13 tess
14 Specifies the tessellation object (created with gluNewTess()).
15
16 location
17 Specifies the location of the vertex.
18
19 data
20 Specifies an opaque pointer passed back to the program with the
21 vertex callback (as specified by gluTessCallback()).
22
24 gluTessVertex describes a vertex on a polygon that the program defines.
25 Successive gluTessVertex calls describe a closed contour. For example,
26 to describe a quadrilateral, gluTessVertex should be called four times.
27 gluTessVertex can only be called between gluTessBeginContour() and
28 gluTessEndContour().
29
30 data normally points to a structure containing the vertex location, as
31 well as other per-vertex attributes such as color and normal. This
32 pointer is passed back to the user through the GLU_TESS_VERTEX or
33 GLU_TESS_VERTEX_DATA callback after tessellation (see the
34 gluTessCallback() reference page).
35
37 A quadrilateral with a triangular hole in it can be described as
38 follows:
39
40 gluTessBeginPolygon(tobj, NULL);
41 gluTessBeginContour(tobj);
42 gluTessVertex(tobj, v1, v1);
43 gluTessVertex(tobj, v2, v2);
44 gluTessVertex(tobj, v3, v3);
45 gluTessVertex(tobj, v4, v4);
46 gluTessEndContour(tobj);
47 gluTessBeginContour(tobj);
48 gluTessVertex(tobj, v5, v5);
49 gluTessVertex(tobj, v6, v6);
50 gluTessVertex(tobj, v7, v7);
51 gluTessEndContour(tobj);
52 gluTessEndPolygon(tobj);
53
54
55
57 It is a common error to use a local variable for location or data and
58 store values into it as part of a loop. For example:
59
60 for (i = 0; i < NVERTICES; ++i) {
61 GLdouble data[3];
62 data[0] = vertex[i][0];
63 data[1] = vertex[i][1];
64 data[2] = vertex[i][2];
65 gluTessVertex(tobj, data, data);
66 }
67
68
69 This doesn't work. Because the pointers specified by location and data
70 might not be dereferenced until gluTessEndPolygon() is executed, all
71 the vertex coordinates but the very last set could be overwritten
72 before tessellation begins.
73
74 Two common symptoms of this problem are when the data consists of a
75 single point (when a local variable is used for data) and a
76 GLU_TESS_NEED_COMBINE_CALLBACK error (when a local variable is used for
77 location).
78
80 gluNewTess(), gluTessBeginContour(), gluTessBeginPolygon(),
81 gluTessCallback(), gluTessEndPolygon(), gluTessNormal(),
82 gluTessProperty()
83
85 Copyright © 1991-2006 Silicon Graphics, Inc. This document is licensed
86 under the SGI Free Software B License. For details, see
87 http://oss.sgi.com/projects/FreeB/.
88
90 opengl.org
91
92
93
94opengl.org 07/13/2018 GLUTESSVERTEX(3G)