Commit | Line | Data |
---|---|---|
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>gluNurbsProperty</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /></head><body><div class="refentry" lang="en" xml:lang="en"><a id="gluNurbsProperty"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>gluNurbsProperty — set a NURBS property</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">gluNurbsProperty</b>(</code></td><td>GLUnurbs* </td><td><var class="pdparam">nurb</var>, </td></tr><tr><td> </td><td>GLenum </td><td><var class="pdparam">property</var>, </td></tr><tr><td> </td><td>GLfloat </td><td><var class="pdparam">value</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><dt><span class="term"><em class="parameter"><code>property</code></em></span></dt><dd><p> | |
6 | Specifies the property to be set. Valid values are | |
7 | <code class="constant">GLU_SAMPLING_TOLERANCE</code>, | |
8 | <code class="constant">GLU_DISPLAY_MODE</code>, | |
9 | <code class="constant">GLU_CULLING</code>, | |
10 | <code class="constant">GLU_AUTO_LOAD_MATRIX</code>, | |
11 | <code class="constant">GLU_PARAMETRIC_TOLERANCE</code>, | |
12 | <code class="constant">GLU_SAMPLING_METHOD</code>, | |
13 | <code class="constant">GLU_U_STEP</code>, | |
14 | <code class="constant">GLU_V_STEP</code>, or | |
15 | <code class="constant">GLU_NURBS_MODE</code>. | |
16 | </p></dd><dt><span class="term"><em class="parameter"><code>value</code></em></span></dt><dd><p> | |
17 | Specifies the value of the indicated property. | |
18 | It may be a numeric value or one of | |
19 | <code class="constant">GLU_OUTLINE_POLYGON</code>, | |
20 | <code class="constant">GLU_FILL</code>, | |
21 | <code class="constant">GLU_OUTLINE_PATCH</code>, | |
22 | <code class="constant">GLU_TRUE</code>, | |
23 | <code class="constant">GLU_FALSE</code>, | |
24 | <code class="constant">GLU_PATH_LENGTH</code>, | |
25 | <code class="constant">GLU_PARAMETRIC_ERROR</code>, | |
26 | <code class="constant">GLU_DOMAIN_DISTANCE</code>, | |
27 | <code class="constant">GLU_NURBS_RENDERER</code>, or | |
28 | <code class="constant">GLU_NURBS_TESSELLATOR</code>. | |
29 | </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p> | |
30 | <code class="function">gluNurbsProperty</code> is used to control properties stored in a NURBS object. These | |
31 | properties affect the way that a NURBS curve is rendered. The accepted | |
32 | values for <em class="parameter"><code>property</code></em> are as follows: | |
33 | </p><div class="variablelist"><dl><dt><span class="term"><code class="constant">GLU_NURBS_MODE</code></span></dt><dd><p> | |
34 | <em class="parameter"><code>value</code></em> should be set to be either <code class="constant">GLU_NURBS_RENDERER</code> or | |
35 | <code class="constant">GLU_NURBS_TESSELLATOR</code>. When set to <code class="constant">GLU_NURBS_RENDERER</code>, NURBS objects | |
36 | are tessellated into OpenGL primitives and sent to the pipeline for | |
37 | rendering. When set to <code class="constant">GLU_NURBS_TESSELLATOR</code>, NURBS objects are | |
38 | tessellated into OpenGL primitives but the vertices, normals, colors, and/or textures are | |
39 | retrieved back through a callback interface (see <a class="citerefentry" href="gluNurbsCallback.xml"><span class="citerefentry"><span class="refentrytitle">gluNurbsCallback</span></span></a>). This allows the user to cache the | |
40 | tessellated results for further processing. | |
41 | The initial value is <code class="constant">GLU_NURBS_RENDERER</code>. | |
42 | </p></dd><dt><span class="term"><code class="constant">GLU_SAMPLING_METHOD</code> </span></dt><dd><p> | |
43 | Specifies how a NURBS surface should be | |
44 | tessellated. | |
45 | <em class="parameter"><code>value</code></em> may be one of <code class="constant">GLU_PATH_LENGTH</code>, | |
46 | <code class="constant">GLU_PARAMETRIC_ERROR</code>, <code class="constant">GLU_DOMAIN_DISTANCE</code>, | |
47 | <code class="constant">GLU_OBJECT_PATH_LENGTH</code>, or | |
48 | <code class="constant">GLU_OBJECT_PARAMETRIC_ERROR</code>. | |
49 | When set to <code class="constant">GLU_PATH_LENGTH</code>, the surface is rendered so that | |
50 | the maximum length, in | |
51 | pixels, of the edges of the tessellation polygons is no greater than | |
52 | what is specified by <code class="constant">GLU_SAMPLING_TOLERANCE</code>. | |
53 | </p><p> | |
54 | <code class="constant">GLU_PARAMETRIC_ERROR</code> specifies that the surface is rendered in such a | |
55 | way that the value specified by <code class="constant">GLU_PARAMETRIC_TOLERANCE</code> describes the | |
56 | maximum distance, in pixels, between the tessellation polygons and the | |
57 | surfaces they approximate. | |
58 | </p><p> | |
59 | <code class="constant">GLU_DOMAIN_DISTANCE</code> allows users to specify, in parametric coordinates, | |
60 | how many sample points per unit length are taken in <span class="emphasis"><em>u</em></span>, <span class="emphasis"><em>v</em></span> | |
61 | direction. | |
62 | </p><p> | |
63 | <code class="constant">GLU_OBJECT_PATH_LENGTH</code> is similar to <code class="constant">GLU_PATH_LENGTH</code> | |
64 | except that it is view independent; that is, the surface is rendered so that the maximum length, in object space, of edges of the tessellation polygons is no greater than what is specified by <code class="constant">GLU_SAMPLING_TOLERANCE</code>. | |
65 | </p><p> | |
66 | <code class="constant">GLU_OBJECT_PARAMETRIC_ERROR</code> is similar to <code class="constant">GLU_PARAMETRIC_ERROR</code> except that it is view independent; that is, the surface is rendered in such a way that the value specified by <code class="constant">GLU_PARAMETRIC_TOLERANCE</code> describes the maximum distance, in object space, between the tessellation polygons and the surfaces they approximate. | |
67 | </p><p> | |
68 | The initial value of <code class="constant">GLU_SAMPLING_METHOD</code> is <code class="constant">GLU_PATH_LENGTH</code>. | |
69 | </p></dd><dt><span class="term"><code class="constant">GLU_SAMPLING_TOLERANCE</code></span></dt><dd><p> | |
70 | Specifies the maximum length, in pixels or in object space length unit, | |
71 | to use when the sampling method is set to <code class="constant">GLU_PATH_LENGTH</code> or | |
72 | <code class="constant">GLU_OBJECT_PATH_LENGTH</code>. | |
73 | The NURBS code is conservative when rendering a curve | |
74 | or surface, so the actual length can be somewhat shorter. The initial | |
75 | value is 50.0 pixels. | |
76 | </p></dd><dt><span class="term"><code class="constant">GLU_PARAMETRIC_TOLERANCE</code></span></dt><dd><p> | |
77 | Specifies the maximum distance, in pixels or in object space length unit, | |
78 | to use when the sampling method is <code class="constant">GLU_PARAMETRIC_ERROR</code> or | |
79 | <code class="constant">GLU_OBJECT_PARAMETRIC_ERROR</code>. | |
80 | The initial value is 0.5. | |
81 | </p></dd><dt><span class="term"><code class="constant">GLU_U_STEP</code></span></dt><dd><p> | |
82 | Specifies the number of sample points per unit length taken | |
83 | along the <span class="emphasis"><em>u</em></span> axis in parametric coordinates. It is needed when | |
84 | <code class="constant">GLU_SAMPLING_METHOD</code> is set to <code class="constant">GLU_DOMAIN_DISTANCE</code>. | |
85 | The initial value is 100. | |
86 | </p></dd><dt><span class="term"><code class="constant">GLU_V_STEP</code></span></dt><dd><p> | |
87 | Specifies the number of sample points per unit length taken | |
88 | along the <span class="emphasis"><em>v</em></span> axis in parametric coordinate. It is needed when | |
89 | <code class="constant">GLU_SAMPLING_METHOD</code> is set to <code class="constant">GLU_DOMAIN_DISTANCE</code>. The initial | |
90 | value is 100. | |
91 | </p></dd><dt><span class="term"><code class="constant">GLU_DISPLAY_MODE</code></span></dt><dd><p> | |
92 | <em class="parameter"><code>value</code></em> can be set to | |
93 | <code class="constant">GLU_OUTLINE_POLYGON</code>, <code class="constant">GLU_FILL</code>, or | |
94 | <code class="constant">GLU_OUTLINE_PATCH</code>. | |
95 | When <code class="constant">GLU_NURBS_MODE</code> is set to be <code class="constant">GLU_NURBS_RENDERER</code>, | |
96 | <em class="parameter"><code>value</code></em> defines how a NURBS surface should be rendered. | |
97 | When <em class="parameter"><code>value</code></em> is set to <code class="constant">GLU_FILL</code>, the surface is rendered as a | |
98 | set of polygons. When <em class="parameter"><code>value</code></em> is set to | |
99 | <code class="constant">GLU_OUTLINE_POLYGON</code>, the NURBS library draws only the outlines | |
100 | of the polygons created by tessellation. When <em class="parameter"><code>value</code></em> is set to | |
101 | <code class="constant">GLU_OUTLINE_PATCH</code> just the outlines of patches and trim | |
102 | curves defined by the user are drawn. | |
103 | </p><p> | |
104 | When <code class="constant">GLU_NURBS_MODE</code> is set to be <code class="constant">GLU_NURBS_TESSELLATOR</code>, | |
105 | <em class="parameter"><code>value</code></em> defines how a NURBS surface should be tessellated. | |
106 | When <code class="constant">GLU_DISPLAY_MODE</code> is set to <code class="constant">GLU_FILL</code> or | |
107 | <code class="constant">GLU_OUTLINE_POLYGON</code>, | |
108 | the NURBS surface is tessellated into OpenGL triangle primitives that can be | |
109 | retrieved back through callback functions. If <code class="constant">GLU_DISPLAY_MODE</code> is set to | |
110 | <code class="constant">GLU_OUTLINE_PATCH</code>, only the outlines of the patches and trim curves are generated as a sequence of line strips that can be retrieved back through callback functions. | |
111 | </p><p> | |
112 | The initial value is <code class="constant">GLU_FILL</code>. | |
113 | </p></dd><dt><span class="term"><code class="constant">GLU_CULLING</code></span></dt><dd><p> | |
114 | <em class="parameter"><code>value</code></em> is a boolean value that, when set to <code class="constant">GLU_TRUE</code>, indicates that | |
115 | a NURBS curve should be discarded prior to tessellation if its control points | |
116 | lie outside the current viewport. The initial value is <code class="constant">GLU_FALSE</code>. | |
117 | </p></dd><dt><span class="term"><code class="constant">GLU_AUTO_LOAD_MATRIX</code></span></dt><dd><p> | |
118 | <em class="parameter"><code>value</code></em> is a boolean value. When set to <code class="constant">GLU_TRUE</code>, the NURBS code | |
119 | downloads the projection matrix, the modelview matrix, and the | |
120 | viewport from the GL server to compute sampling and | |
121 | culling | |
122 | matrices for each NURBS curve that is rendered. Sampling and culling matrices | |
123 | are required to determine the tessellation of a NURBS surface into line segments | |
124 | or polygons and to cull a NURBS surface if it lies outside the viewport. | |
125 | </p><p> | |
126 | If this mode is set to <code class="constant">GLU_FALSE</code>, then the program needs | |
127 | to provide a projection matrix, a modelview matrix, and a viewport | |
128 | for the NURBS renderer to use to construct sampling and culling matrices. | |
129 | This can be done with the <a class="citerefentry" href="gluLoadSamplingMatrices.xml"><span class="citerefentry"><span class="refentrytitle">gluLoadSamplingMatrices</span></span></a> function. | |
130 | This mode is initially set to <code class="constant">GLU_TRUE</code>. | |
131 | Changing it from <code class="constant">GLU_TRUE</code> to <code class="constant">GLU_FALSE</code> does not affect | |
132 | the sampling and culling matrices until | |
133 | <a class="citerefentry" href="gluLoadSamplingMatrices.xml"><span class="citerefentry"><span class="refentrytitle">gluLoadSamplingMatrices</span></span></a> | |
134 | is called. | |
135 | </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="notes"></a><h2>Notes</h2><p> | |
136 | If <code class="constant">GLU_AUTO_LOAD_MATRIX</code> is true, sampling and culling may be | |
137 | executed incorrectly if NURBS routines are compiled into a display list. | |
138 | </p><p> | |
139 | A <em class="parameter"><code>property</code></em> of | |
140 | <code class="constant">GLU_PARAMETRIC_TOLERANCE</code>, | |
141 | <code class="constant">GLU_SAMPLING_METHOD</code>, | |
142 | <code class="constant">GLU_U_STEP</code>, or | |
143 | <code class="constant">GLU_V_STEP</code>, | |
144 | or a <em class="parameter"><code>value</code></em> of | |
145 | <code class="constant">GLU_PATH_LENGTH</code>, | |
146 | <code class="constant">GLU_PARAMETRIC_ERROR</code>, | |
147 | <code class="constant">GLU_DOMAIN_DISTANCE</code> | |
148 | are only available if the GLU version is 1.1 or greater. They are not | |
149 | valid parameters in GLU 1.0. | |
150 | </p><p> | |
151 | <a class="citerefentry" href="gluGetString.xml"><span class="citerefentry"><span class="refentrytitle">gluGetString</span></span></a> can | |
152 | be used to determine the GLU version. | |
153 | </p><p> | |
154 | <code class="constant">GLU_NURBS_MODE</code> is only available if the GLU version is 1.3 or | |
155 | greater. | |
156 | </p><p> | |
157 | The <code class="constant">GLU_OBJECT_PATH_LENGTH</code> and <code class="constant">GLU_OBJECT_PARAMETRIC_ERROR</code> | |
158 | values for the <code class="constant">GLU_SAMPLING_METHOD</code> property are only available if | |
159 | the GLU version is 1.3 or greater. | |
160 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p> | |
161 | <a class="citerefentry" href="gluGetNurbsProperty.xml"><span class="citerefentry"><span class="refentrytitle">gluGetNurbsProperty</span></span></a>, | |
162 | <a class="citerefentry" href="gluGetString.xml"><span class="citerefentry"><span class="refentrytitle">gluGetString</span></span></a>, | |
163 | <a class="citerefentry" href="gluLoadSamplingMatrices.xml"><span class="citerefentry"><span class="refentrytitle">gluLoadSamplingMatrices</span></span></a>, | |
164 | <a class="citerefentry" href="gluNewNurbsRenderer.xml"><span class="citerefentry"><span class="refentrytitle">gluNewNurbsRenderer</span></span></a>, | |
165 | <a class="citerefentry" href="gluNurbsCallback.xml"><span class="citerefentry"><span class="refentrytitle">gluNurbsCallback</span></span></a> | |
166 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="Copyright"></a><h2>Copyright</h2><p> | |
167 | Copyright <span class="trademark"></span>© 1991-2006 | |
168 | Silicon Graphics, Inc. This document is licensed under the SGI | |
169 | Free Software B License. For details, see | |
170 | <a class="ulink" href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>. | |
171 | </p></div></div></body></html> |