gluNurbsSurface
[New
- Windows 95, OEM Service Release 2]
The gluNurbsSurface function defines the shape
of a NURBS surface.
void gluNurbsSurface(
GLUnurbsObj * nobj, |
|
GLint sknot_count, |
|
GLfloat * sknot, |
|
GLint tknot_count, |
|
GLfloat * tknot, |
|
GLint s_stride,
|
|
GLint t_stride,
|
|
GLfloat * ctlarray, |
|
GLint sorder,
|
|
GLint torder,
|
|
GLenum type |
|
); |
|
Parameters
nobj
The NURBS
object (created with gluNewNurbsRenderer
sknot_count
The number of
knots in the parametric u direction.
sknot
An array of sknot_count
nondecreasing knot values in the parametric u direction.
tknot_count
The number of
knots in the parametric v direction.
tknot
An array of tknot_count
nondecreasing knot values in the parametric v direction.
s_stride
The offset
(as a number of single-precision floating-point values) between successive control
points in the parametric u direction in ctlarray.
t_stride
The offset
(in single-precision floating-point values) between successive control points
in the parametric v direction in ctlarray.
ctlarray
An array
containing control points for the NURBS surface. The offsets between successive
control points in the parametric u and v directions are given by s_stride
and t_stride.
sorder
The order of
the NURBS surface in the parametric u direction. The order is one more
than the degree, hence a surface that is cubic in u has a u order
of 4.
torder
The order of
the NURBS surface in the parametric v direction. The order is one more
than the degree, hence a surface that is cubic in v has a v order
of 4.
type
The type of
the surface. The type parameter can be any of the valid two-dimensional
evaluator types (such as GL_MAP2_VERTEX_3 or GL_MAP2_COLOR_4).
Remarks
Use gluNurbsSurface within a NURBS (Non-Uniform
Rational B-Spline) surface definition to describe the shape of a NURBS surface
(before any trimming). To mark the beginning of a NURBS surface definition, use
the gluBeginSurface
You associate positional, texture, and color
coordinates with a surface by presenting each as a separate gluNurbsSurface
between a gluBeginSurface/gluEndSurface pair. Within a single gluBeginSurface/gluEndSurface
pair, you can make only one call to gluNurbsSurface for color, position,
and texture data. Make exactly one call to describe the position of the surface
(a type of GL_MAP2_VERTEX_3 or GL_MAP2_VERTEX_4).
You can trim a NURBS surface by using the gluNurbsCurve
Note A gluNurbsSurface
with sknot_count knots in the u direction and tknot_count
knots in the v direction with orders sorder and torder
must have (sknot_count - sorder) multipied by (tknot_count
- torder) control points.
Example
The following
functions render a textured NURBS surface with normals; the texture coordinates
and normals are also NURBS surfaces:
gluBeginSurface(nobj);
gluNurbsSurface(nobj, . . ., GL_MAP2_TEXTURE_COORD_2);
gluNurbsSurface(nobj, . . ., GL_MAP2_NORMAL);
gluNurbsSurface(nobj, . . ., GL_MAP2_VERTEX_4);
gluEndSurface(nobj);
See Also
gluBeginSurface, gluBeginTrim