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=
"gluNurbsSurface">
9 <holder>Silicon Graphics, Inc.
</holder>
12 <refentrytitle>gluNurbsSurface
</refentrytitle>
13 <manvolnum>3G
</manvolnum>
16 <refname>gluNurbsSurface
</refname>
17 <refpurpose>define the shape of a NURBS surface
</refpurpose>
19 <refsynopsisdiv><title>C Specification
</title>
22 <funcdef>void
<function>gluNurbsSurface
</function></funcdef>
23 <paramdef>GLUnurbs*
<parameter>nurb
</parameter></paramdef>
24 <paramdef>GLint
<parameter>sKnotCount
</parameter></paramdef>
25 <paramdef>GLfloat*
<parameter>sKnots
</parameter></paramdef>
26 <paramdef>GLint
<parameter>tKnotCount
</parameter></paramdef>
27 <paramdef>GLfloat*
<parameter>tKnots
</parameter></paramdef>
28 <paramdef>GLint
<parameter>sStride
</parameter></paramdef>
29 <paramdef>GLint
<parameter>tStride
</parameter></paramdef>
30 <paramdef>GLfloat*
<parameter>control
</parameter></paramdef>
31 <paramdef>GLint
<parameter>sOrder
</parameter></paramdef>
32 <paramdef>GLint
<parameter>tOrder
</parameter></paramdef>
33 <paramdef>GLenum
<parameter>type
</parameter></paramdef>
37 <!-- eqn: ignoring delim $$ -->
38 <refsect1 id=
"parameters"><title>Parameters
</title>
41 <term><parameter>nurb
</parameter></term>
44 Specifies the NURBS object (created with
<citerefentry><refentrytitle>gluNewNurbsRenderer
</refentrytitle></citerefentry>).
49 <term><parameter>sKnotCount
</parameter></term>
52 Specifies the number of knots in the parametric
<emphasis>u
</emphasis> direction.
57 <term><parameter>sKnots
</parameter></term>
60 Specifies an array of
<parameter>sKnotCount
</parameter> nondecreasing knot values in the parametric
61 <emphasis>u
</emphasis> direction.
66 <term><parameter>tKnotCount
</parameter></term>
69 Specifies the number of knots in the parametric
<emphasis>v
</emphasis> direction.
74 <term><parameter>tKnots
</parameter></term>
77 Specifies an array of
<parameter>tKnotCount
</parameter> nondecreasing knot values in the parametric
78 <emphasis>v
</emphasis> direction.
83 <term><parameter>sStride
</parameter></term>
86 Specifies the offset (as a number of single-precision floating-point values)
87 between successive control points in the parametric
<emphasis>u
</emphasis> direction
88 in
<parameter>control
</parameter>.
93 <term><parameter>tStride
</parameter></term>
96 Specifies the offset (in single-precision floating-point values)
97 between successive control points in the parametric
<emphasis>v
</emphasis> direction
98 in
<parameter>control
</parameter>.
103 <term><parameter>control
</parameter></term>
106 Specifies an array containing control points for the NURBS surface.
107 The offsets between successive control points in the parametric
<emphasis>u
</emphasis>
108 and
<emphasis>v
</emphasis> directions are given by
<parameter>sStride
</parameter> and
<parameter>tStride
</parameter>.
113 <term><parameter>sOrder
</parameter></term>
116 Specifies the order of the NURBS surface in the parametric
<emphasis>u
</emphasis>
117 direction. The order is one more than the degree, hence
118 a surface that is cubic in
<emphasis>u
</emphasis> has a
<emphasis>u
</emphasis> order of
4.
123 <term><parameter>tOrder
</parameter></term>
126 Specifies the order of the NURBS surface in the parametric
<emphasis>v
</emphasis>
127 direction. The order is one more than the degree, hence
128 a surface that is cubic in
<emphasis>v
</emphasis> has a
<emphasis>v
</emphasis> order of
4.
133 <term><parameter>type
</parameter></term>
136 Specifies type of the surface.
<parameter>type
</parameter> can be any of the valid
137 two-dimensional evaluator types (such as
<constant>GLU_MAP2_VERTEX_3
</constant> or
138 <constant>GLU_MAP2_COLOR_4
</constant>).
144 <refsect1 id=
"description"><title>Description
</title>
146 Use
<function>gluNurbsSurface
</function> within a NURBS (Non-Uniform Rational B-Spline) surface
147 definition to describe the shape of a NURBS surface (before
148 any trimming). To mark the beginning of
149 a NURBS surface definition, use the
<citerefentry><refentrytitle>gluBeginSurface
</refentrytitle></citerefentry> command.
150 To mark the end of a NURBS surface definition, use the
151 <citerefentry><refentrytitle>gluEndSurface
</refentrytitle></citerefentry> command. Call
<function>gluNurbsSurface
</function> within a NURBS
152 surface definition only.
155 Positional, texture, and color coordinates are associated
156 with a surface by presenting each as a separate
<function>gluNurbsSurface
</function> between a
157 <citerefentry><refentrytitle>gluBeginSurface
</refentrytitle></citerefentry>/
<citerefentry><refentrytitle>gluEndSurface
</refentrytitle></citerefentry> pair. No more than
158 one call to
<function>gluNurbsSurface
</function> for each of color, position, and texture
159 data can be made within a single
<citerefentry><refentrytitle>gluBeginSurface
</refentrytitle></citerefentry>/
<citerefentry><refentrytitle>gluEndSurface
</refentrytitle></citerefentry>
160 pair. Exactly one call must be made to describe the position of the
161 surface (a
<parameter>type
</parameter> of
<constant>GLU_MAP2_VERTEX_3
</constant> or
<constant>GLU_MAP2_VERTEX_4
</constant>).
164 A NURBS surface can be trimmed by using the commands
165 <citerefentry><refentrytitle>gluNurbsCurve
</refentrytitle></citerefentry> and
<citerefentry><refentrytitle>gluPwlCurve
</refentrytitle></citerefentry> between calls to
166 <citerefentry><refentrytitle>gluBeginTrim
</refentrytitle></citerefentry> and
<citerefentry><refentrytitle>gluEndTrim
</refentrytitle></citerefentry>.
169 Note that a
<function>gluNurbsSurface
</function> with
<parameter>sKnotCount
</parameter> knots in the
<emphasis>u
</emphasis> direction
170 and
<parameter>tKnotCount
</parameter> knots in the
<emphasis>v
</emphasis> direction with orders
171 <parameter>sOrder
</parameter> and
<parameter>tOrder
</parameter> must have
172 (
<parameter>sKnotCount
</parameter> -
<parameter>sOrder
</parameter>)
173 <inlineequation><mml:math><mml:mi mathvariant=
"italic">times
</mml:mi></mml:math></inlineequation>
174 (
<parameter>tKnotCount
</parameter> -
<parameter>tOrder
</parameter>) control points.
177 <refsect1 id=
"example"><title>Example
</title>
179 The following commands render a textured NURBS surface with normals;
180 the texture coordinates and normals are also NURBS surfaces:
182 gluBeginSurface(nobj);
183 gluNurbsSurface(nobj, ..., GL_MAP2_TEXTURE_COORD_2);
184 gluNurbsSurface(nobj, ..., GL_MAP2_NORMAL);
185 gluNurbsSurface(nobj, ..., GL_MAP2_VERTEX_4);
190 <refsect1 id=
"seealso"><title>See Also
</title>
192 <citerefentry><refentrytitle>gluBeginSurface
</refentrytitle></citerefentry>,
193 <citerefentry><refentrytitle>gluBeginTrim
</refentrytitle></citerefentry>,
194 <citerefentry><refentrytitle>gluNewNurbsRenderer
</refentrytitle></citerefentry>,
195 <citerefentry><refentrytitle>gluNurbsCurve
</refentrytitle></citerefentry>,
196 <citerefentry><refentrytitle>gluPwlCurve
</refentrytitle></citerefentry>
199 <refsect1 id=
"Copyright"><title>Copyright
</title>
201 Copyright
<trademark class=
"copyright"></trademark> 1991-
2006
202 Silicon Graphics, Inc. This document is licensed under the SGI
203 Free Software B License. For details, see
204 <ulink url=
"http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/
</ulink>.