1GLUBEGINTRIM(3G)                 OpenGL Manual                GLUBEGINTRIM(3G)
2
3
4

NAME

6       gluBeginTrim - delimit a NURBS trimming loop definition
7

C SPECIFICATION

9       void gluBeginTrim(GLUnurbs* nurb);
10

C SPECIFICATION

12       void gluEndTrim(GLUnurbs* nurb);
13

PARAMETERS

15       nurb
16           Specifies the NURBS object (created with gluNewNurbsRenderer()).
17

DESCRIPTION

19       Use gluBeginTrim to mark the beginning of a trimming loop and
20       gluEndTrim() to mark the end of a trimming loop. A trimming loop is a
21       set of oriented curve segments (forming a closed curve) that define
22       boundaries of a NURBS surface. You include these trimming loops in the
23       definition of a NURBS surface, between calls to gluBeginSurface() and
24       gluEndSurface().
25
26       The definition for a NURBS surface can contain many trimming loops. For
27       example, if you wrote a definition for a NURBS surface that resembled a
28       rectangle with a hole punched out, the definition would contain two
29       trimming loops. One loop would define the outer edge of the rectangle;
30       the other would define the hole punched out of the rectangle. The
31       definitions of each of these trimming loops would be bracketed by a
32       gluBeginTrim/gluEndTrim() pair.
33
34       The definition of a single closed trimming loop can consist of multiple
35       curve segments, each described as a piecewise linear curve (see
36       gluPwlCurve()) or as a single NURBS curve (see gluNurbsCurve()), or as
37       a combination of both in any order. The only library calls that can
38       appear in a trimming loop definition (between the calls to gluBeginTrim
39       and gluEndTrim()) are gluPwlCurve() and gluNurbsCurve().
40
41       The area of the NURBS surface that is displayed is the region in the
42       domain to the left of the trimming curve as the curve parameter
43       increases. Thus, the retained region of the NURBS surface is inside a
44       counterclockwise trimming loop and outside a clockwise trimming loop.
45       For the rectangle mentioned earlier, the trimming loop for the outer
46       edge of the rectangle runs counterclockwise, while the trimming loop
47       for the punched-out hole runs clockwise.
48
49       If you use more than one curve to define a single trimming loop, the
50       curve segments must form a closed loop (that is, the endpoint of each
51       curve must be the starting point of the next curve, and the endpoint of
52       the final curve must be the starting point of the first curve). If the
53       endpoints of the curve are sufficiently close together but not exactly
54       coincident, they will be coerced to match. If the endpoints are not
55       sufficiently close, an error results (see gluNurbsCallback()).
56
57       If a trimming loop definition contains multiple curves, the direction
58       of the curves must be consistent (that is, the inside must be to the
59       left of all of the curves). Nested trimming loops are legal as long as
60       the curve orientations alternate correctly. If trimming curves are
61       self-intersecting, or intersect one another, an error results.
62
63       If no trimming information is given for a NURBS surface, the entire
64       surface is drawn.
65

EXAMPLE

67       This code fragment defines a trimming loop that consists of one
68       piecewise linear curve, and two NURBS curves:
69
70           gluBeginTrim(nobj);
71              gluPwlCurve(..., GLU_MAP1_TRIM_2);
72              gluNurbsCurve(..., GLU_MAP1_TRIM_2);
73              gluNurbsCurve(..., GLU_MAP1_TRIM_3);
74           gluEndTrim(nobj);
75
76
77

SEE ALSO

79       gluBeginSurface(), gluNewNurbsRenderer(), gluNurbsCallback(),
80       gluNurbsCurve(), gluPwlCurve()
81
83       Copyright © 1991-2006 Silicon Graphics, Inc. This document is licensed
84       under the SGI Free Software B License. For details, see
85       http://oss.sgi.com/projects/FreeB/.
86

AUTHORS

88       opengl.org
89
90
91
92opengl.org                        06/10/2014                  GLUBEGINTRIM(3G)
Impressum