143 lines
6.5 KiB
XML
143 lines
6.5 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
|
|
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
|
|
<refentry id="gluTessVertex">
|
|
<refmeta>
|
|
<refmetainfo>
|
|
<copyright>
|
|
<year>1991-2006</year>
|
|
<holder>Silicon Graphics, Inc.</holder>
|
|
</copyright>
|
|
</refmetainfo>
|
|
<refentrytitle>gluTessVertex</refentrytitle>
|
|
<manvolnum>3G</manvolnum>
|
|
</refmeta>
|
|
<refnamediv>
|
|
<refname>gluTessVertex</refname>
|
|
<refpurpose>specify a vertex on a polygon</refpurpose>
|
|
</refnamediv>
|
|
<refsynopsisdiv><title>C Specification</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>void <function>gluTessVertex</function></funcdef>
|
|
<paramdef>GLUtesselator* <parameter>tess</parameter></paramdef>
|
|
<paramdef>GLdouble * <parameter>location</parameter></paramdef>
|
|
<paramdef>GLvoid* <parameter>data</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
</refsynopsisdiv>
|
|
<!-- eqn: ignoring delim $$ -->
|
|
<refsect1 id="parameters"><title>Parameters</title>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>tess</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Specifies the tessellation object (created with <citerefentry><refentrytitle>gluNewTess</refentrytitle></citerefentry>).
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>location</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Specifies the location of the vertex.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>data</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Specifies an opaque pointer passed back to the program with the vertex callback
|
|
(as specified by <citerefentry><refentrytitle>gluTessCallback</refentrytitle></citerefentry>).
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</refsect1>
|
|
<refsect1 id="description"><title>Description</title>
|
|
<para>
|
|
<function>gluTessVertex</function> describes a vertex on a polygon that the program defines. Successive
|
|
<function>gluTessVertex</function> calls describe a closed contour. For example,
|
|
to describe a quadrilateral, <function>gluTessVertex</function> should be called four times.
|
|
<function>gluTessVertex</function> can only be called between <citerefentry><refentrytitle>gluTessBeginContour</refentrytitle></citerefentry> and
|
|
<citerefentry><refentrytitle>gluTessEndContour</refentrytitle></citerefentry>.
|
|
</para>
|
|
<para>
|
|
<parameter>data</parameter> normally points to a structure containing the vertex
|
|
location, as well as other per-vertex attributes such as color and normal.
|
|
This pointer is passed back to the user through the <constant>GLU_TESS_VERTEX</constant>
|
|
or <constant>GLU_TESS_VERTEX_DATA</constant> callback after tessellation
|
|
(see the <citerefentry><refentrytitle>gluTessCallback</refentrytitle></citerefentry> reference page).
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 id="example"><title>Example</title>
|
|
<para>
|
|
A quadrilateral with a triangular hole in it can be described as follows:
|
|
<programlisting>
|
|
gluTessBeginPolygon(tobj, NULL);
|
|
gluTessBeginContour(tobj);
|
|
gluTessVertex(tobj, v1, v1);
|
|
gluTessVertex(tobj, v2, v2);
|
|
gluTessVertex(tobj, v3, v3);
|
|
gluTessVertex(tobj, v4, v4);
|
|
gluTessEndContour(tobj);
|
|
gluTessBeginContour(tobj);
|
|
gluTessVertex(tobj, v5, v5);
|
|
gluTessVertex(tobj, v6, v6);
|
|
gluTessVertex(tobj, v7, v7);
|
|
gluTessEndContour(tobj);
|
|
gluTessEndPolygon(tobj);
|
|
</programlisting>
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 id="notes"><title>Notes</title>
|
|
<para>
|
|
It is a common error to use a local variable for <parameter>location</parameter> or <parameter>data</parameter> and store
|
|
values into it as part of a loop.
|
|
For example:
|
|
<programlisting>
|
|
for (i = 0; i < NVERTICES; ++i) {
|
|
GLdouble data[3];
|
|
data[0] = vertex[i][0];
|
|
data[1] = vertex[i][1];
|
|
data[2] = vertex[i][2];
|
|
gluTessVertex(tobj, data, data);
|
|
}
|
|
</programlisting>
|
|
</para>
|
|
<para>
|
|
This doesn't work.
|
|
Because the pointers specified by <parameter>location</parameter> and <parameter>data</parameter> might not be
|
|
dereferenced until <citerefentry><refentrytitle>gluTessEndPolygon</refentrytitle></citerefentry> is executed,
|
|
all the vertex coordinates but the very last set could be overwritten
|
|
before tessellation begins.
|
|
</para>
|
|
<para>
|
|
Two common symptoms of this problem are when the data consists of a single
|
|
point (when a local variable is used for <parameter>data</parameter>) and a
|
|
<constant>GLU_TESS_NEED_COMBINE_CALLBACK</constant> error (when a local variable is
|
|
used for <parameter>location</parameter>).
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 id="seealso"><title>See Also</title>
|
|
<para>
|
|
<citerefentry><refentrytitle>gluNewTess</refentrytitle></citerefentry>,
|
|
<citerefentry><refentrytitle>gluTessBeginContour</refentrytitle></citerefentry>,
|
|
<citerefentry><refentrytitle>gluTessBeginPolygon</refentrytitle></citerefentry>,
|
|
<citerefentry><refentrytitle>gluTessCallback</refentrytitle></citerefentry>,
|
|
<citerefentry><refentrytitle>gluTessEndPolygon</refentrytitle></citerefentry>,
|
|
<citerefentry><refentrytitle>gluTessNormal</refentrytitle></citerefentry>,
|
|
<citerefentry><refentrytitle>gluTessProperty</refentrytitle></citerefentry>
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 id="Copyright"><title>Copyright</title>
|
|
<para>
|
|
Copyright <trademark class="copyright"></trademark> 1991-2006
|
|
Silicon Graphics, Inc. This document is licensed under the SGI
|
|
Free Software B License. For details, see
|
|
<ulink url="http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/</ulink>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|