1 <?xml version=
"1.0" encoding=
"UTF-8"?>
2 <!DOCTYPE book PUBLIC
"-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
3 "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
4 <refentry id=
"gluTessVertex">
9 <holder>Silicon Graphics, Inc.
</holder>
12 <refentrytitle>gluTessVertex
</refentrytitle>
13 <manvolnum>3G
</manvolnum>
16 <refname>gluTessVertex
</refname>
17 <refpurpose>specify a vertex on a polygon
</refpurpose>
19 <refsynopsisdiv><title>C Specification
</title>
22 <funcdef>void
<function>gluTessVertex
</function></funcdef>
23 <paramdef>GLUtesselator*
<parameter>tess
</parameter></paramdef>
24 <paramdef>GLdouble *
<parameter>location
</parameter></paramdef>
25 <paramdef>GLvoid*
<parameter>data
</parameter></paramdef>
29 <!-- eqn: ignoring delim $$ -->
30 <refsect1 id=
"parameters"><title>Parameters
</title>
33 <term><parameter>tess
</parameter></term>
36 Specifies the tessellation object (created with
<citerefentry><refentrytitle>gluNewTess
</refentrytitle></citerefentry>).
41 <term><parameter>location
</parameter></term>
44 Specifies the location of the vertex.
49 <term><parameter>data
</parameter></term>
52 Specifies an opaque pointer passed back to the program with the vertex callback
53 (as specified by
<citerefentry><refentrytitle>gluTessCallback
</refentrytitle></citerefentry>).
59 <refsect1 id=
"description"><title>Description
</title>
61 <function>gluTessVertex
</function> describes a vertex on a polygon that the program defines. Successive
62 <function>gluTessVertex
</function> calls describe a closed contour. For example,
63 to describe a quadrilateral,
<function>gluTessVertex
</function> should be called four times.
64 <function>gluTessVertex
</function> can only be called between
<citerefentry><refentrytitle>gluTessBeginContour
</refentrytitle></citerefentry> and
65 <citerefentry><refentrytitle>gluTessEndContour
</refentrytitle></citerefentry>.
68 <parameter>data
</parameter> normally points to a structure containing the vertex
69 location, as well as other per-vertex attributes such as color and normal.
70 This pointer is passed back to the user through the
<constant>GLU_TESS_VERTEX
</constant>
71 or
<constant>GLU_TESS_VERTEX_DATA
</constant> callback after tessellation
72 (see the
<citerefentry><refentrytitle>gluTessCallback
</refentrytitle></citerefentry> reference page).
75 <refsect1 id=
"example"><title>Example
</title>
77 A quadrilateral with a triangular hole in it can be described as follows:
79 gluTessBeginPolygon(tobj, NULL);
80 gluTessBeginContour(tobj);
81 gluTessVertex(tobj, v1, v1);
82 gluTessVertex(tobj, v2, v2);
83 gluTessVertex(tobj, v3, v3);
84 gluTessVertex(tobj, v4, v4);
85 gluTessEndContour(tobj);
86 gluTessBeginContour(tobj);
87 gluTessVertex(tobj, v5, v5);
88 gluTessVertex(tobj, v6, v6);
89 gluTessVertex(tobj, v7, v7);
90 gluTessEndContour(tobj);
91 gluTessEndPolygon(tobj);
95 <refsect1 id=
"notes"><title>Notes
</title>
97 It is a common error to use a local variable for
<parameter>location
</parameter> or
<parameter>data
</parameter> and store
98 values into it as part of a loop.
101 for (i =
0; i
< NVERTICES; ++i) {
103 data[
0] = vertex[i][
0];
104 data[
1] = vertex[i][
1];
105 data[
2] = vertex[i][
2];
106 gluTessVertex(tobj, data, data);
112 Because the pointers specified by
<parameter>location
</parameter> and
<parameter>data
</parameter> might not be
113 dereferenced until
<citerefentry><refentrytitle>gluTessEndPolygon
</refentrytitle></citerefentry> is executed,
114 all the vertex coordinates but the very last set could be overwritten
115 before tessellation begins.
118 Two common symptoms of this problem are when the data consists of a single
119 point (when a local variable is used for
<parameter>data
</parameter>) and a
120 <constant>GLU_TESS_NEED_COMBINE_CALLBACK
</constant> error (when a local variable is
121 used for
<parameter>location
</parameter>).
124 <refsect1 id=
"seealso"><title>See Also
</title>
126 <citerefentry><refentrytitle>gluNewTess
</refentrytitle></citerefentry>,
127 <citerefentry><refentrytitle>gluTessBeginContour
</refentrytitle></citerefentry>,
128 <citerefentry><refentrytitle>gluTessBeginPolygon
</refentrytitle></citerefentry>,
129 <citerefentry><refentrytitle>gluTessCallback
</refentrytitle></citerefentry>,
130 <citerefentry><refentrytitle>gluTessEndPolygon
</refentrytitle></citerefentry>,
131 <citerefentry><refentrytitle>gluTessNormal
</refentrytitle></citerefentry>,
132 <citerefentry><refentrytitle>gluTessProperty
</refentrytitle></citerefentry>
135 <refsect1 id=
"Copyright"><title>Copyright
</title>
137 Copyright
<trademark class=
"copyright"></trademark> 1991-
2006
138 Silicon Graphics, Inc. This document is licensed under the SGI
139 Free Software B License. For details, see
140 <ulink url=
"http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/
</ulink>.