rename upstream-man-pages to upstream-doc
[clinton/guile-figl.git] / upstream-doc / man2 / xhtml / gluBeginTrim.xml
CommitLineData
7faf1d71
AW
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "xhtml1-transitional.dtd">
2<!-- saved from url=(0013)about:internet -->
3<?xml-stylesheet type="text/xsl" href="mathml.xsl"?><html xmlns="http://www.w3.org/1999/xhtml" xmlns:pref="http://www.w3.org/2002/Math/preference" pref:renderer="mathplayer-dl"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>gluBeginTrim</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /></head><body><div class="refentry" lang="en" xml:lang="en"><a id="gluBeginTrim"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>gluBeginTrim — delimit a NURBS trimming loop definition</p></div><div class="refsynopsisdiv"><h2>C Specification</h2><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">void <b class="fsfunc">gluBeginTrim</b>(</code></td><td>GLUnurbs*  </td><td><var class="pdparam">nurb</var><code>)</code>;</td></tr></table></div></div><div class="refsynopsisdiv"><h2>C Specification</h2><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">void <b class="fsfunc">gluEndTrim</b>(</code></td><td>GLUnurbs*  </td><td><var class="pdparam">nurb</var><code>)</code>;</td></tr></table></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="parameters"></a><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><em class="parameter"><code>nurb</code></em></span></dt><dd><p>
4 Specifies the NURBS object (created with <a class="citerefentry" href="gluNewNurbsRenderer.xml"><span class="citerefentry"><span class="refentrytitle">gluNewNurbsRenderer</span></span></a>).
5 </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p>
6 Use <code class="function">gluBeginTrim</code> to mark the beginning of a
7 trimming loop and <a class="citerefentry" href="gluEndTrim.xml"><span class="citerefentry"><span class="refentrytitle">gluEndTrim</span></span></a> to mark the end
8 of a trimming loop. A trimming loop is
9 a set of oriented curve segments (forming a closed curve) that
10 define boundaries of a NURBS surface. You include these
11 trimming loops in the definition of a NURBS
12 surface, between calls to <a class="citerefentry" href="gluBeginSurface.xml"><span class="citerefentry"><span class="refentrytitle">gluBeginSurface</span></span></a> and <a class="citerefentry" href="gluEndSurface.xml"><span class="citerefentry"><span class="refentrytitle">gluEndSurface</span></span></a>.
13 </p><p>
14 The definition for a NURBS surface can contain many
15 trimming loops. For example, if you wrote a definition
16 for a NURBS surface that resembled a rectangle with
17 a hole punched out, the definition would contain two
18 trimming loops. One loop would define the outer edge
19 of the rectangle; the other would define
20 the hole punched out of the rectangle. The definitions
21 of each of these trimming loops would be bracketed by a
22 <code class="function">gluBeginTrim</code>/<a class="citerefentry" href="gluEndTrim.xml"><span class="citerefentry"><span class="refentrytitle">gluEndTrim</span></span></a> pair.
23 </p><p>
24 The definition of a single closed trimming loop can consist
25 of multiple curve segments, each described as a piecewise
26 linear curve (see <a class="citerefentry" href="gluPwlCurve.xml"><span class="citerefentry"><span class="refentrytitle">gluPwlCurve</span></span></a>) or as a single NURBS
27 curve (see <a class="citerefentry" href="gluNurbsCurve.xml"><span class="citerefentry"><span class="refentrytitle">gluNurbsCurve</span></span></a>), or as a combination of
28 both in any order. The only library calls that can
29 appear in a trimming loop definition (between the calls
30 to <code class="function">gluBeginTrim</code> and <a class="citerefentry" href="gluEndTrim.xml"><span class="citerefentry"><span class="refentrytitle">gluEndTrim</span></span></a>) are
31 <a class="citerefentry" href="gluPwlCurve.xml"><span class="citerefentry"><span class="refentrytitle">gluPwlCurve</span></span></a> and <a class="citerefentry" href="gluNurbsCurve.xml"><span class="citerefentry"><span class="refentrytitle">gluNurbsCurve</span></span></a>.
32 </p><p>
33 The area of the NURBS surface that is displayed is the
34 region in the domain to the left of the trimming curve
35 as the curve parameter increases. Thus, the retained
36 region of the NURBS surface is inside a
37 counterclockwise trimming loop and outside a clockwise
38 trimming loop. For the rectangle mentioned earlier,
39 the trimming loop for the outer edge of the rectangle runs
40 counterclockwise, while the trimming loop for the punched-out hole
41 runs clockwise.
42 </p><p>
43 If you use more than one curve to define a single trimming
44 loop, the curve segments must form a closed loop (that is,
45 the endpoint of each curve must be the starting point of the
46 next curve, and the endpoint of the final curve must
47 be the starting point of the first curve). If the
48 endpoints of the curve are sufficiently close together
49 but not exactly coincident, they will be coerced to match.
50 If the endpoints are not sufficiently close, an error results
51 (see <a class="citerefentry" href="gluNurbsCallback.xml"><span class="citerefentry"><span class="refentrytitle">gluNurbsCallback</span></span></a>).
52 </p><p>
53 If a trimming loop definition contains multiple curves,
54 the direction of the curves must be consistent (that is, the
55 inside must be to the left of all of the curves). Nested
56 trimming loops are legal as long as the curve orientations
57 alternate correctly.
58 If trimming curves are self-intersecting,
59 or intersect one another, an error results.
60 </p><p>
61 If no trimming information is given
62 for a NURBS surface, the entire surface is drawn.
63 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="example"></a><h2>Example</h2><p>
64 This code fragment defines a trimming loop that consists of one
65 piecewise linear curve, and two NURBS curves:
66 </p><pre class="programlisting">
67gluBeginTrim(nobj);
68 gluPwlCurve(..., GLU_MAP1_TRIM_2);
69 gluNurbsCurve(..., GLU_MAP1_TRIM_2);
70 gluNurbsCurve(..., GLU_MAP1_TRIM_3);
71gluEndTrim(nobj);
72 </pre><p>
73 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p>
74 <a class="citerefentry" href="gluBeginSurface.xml"><span class="citerefentry"><span class="refentrytitle">gluBeginSurface</span></span></a>,
75 <a class="citerefentry" href="gluNewNurbsRenderer.xml"><span class="citerefentry"><span class="refentrytitle">gluNewNurbsRenderer</span></span></a>,
76 <a class="citerefentry" href="gluNurbsCallback.xml"><span class="citerefentry"><span class="refentrytitle">gluNurbsCallback</span></span></a>,
77 <a class="citerefentry" href="gluNurbsCurve.xml"><span class="citerefentry"><span class="refentrytitle">gluNurbsCurve</span></span></a>,
78 <a class="citerefentry" href="gluPwlCurve.xml"><span class="citerefentry"><span class="refentrytitle">gluPwlCurve</span></span></a>
79 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="Copyright"></a><h2>Copyright</h2><p>
80 Copyright <span class="trademark"></span>© 1991-2006
81 Silicon Graphics, Inc. This document is licensed under the SGI
82 Free Software B License. For details, see
83 <a class="ulink" href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>.
84 </p></div></div></body></html>