[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]
OpenGL 1.2 for AIX: Reference Manual

gluNurbsSurface Subroutine

Purpose

Defines the shape of a non-uniform rational B-spline (NURBS) surface.

Library

OpenGL C bindings library: libGL.a

C Syntax

void gluNurbsSurface(GLUnurbs* nurb, 
   GLint sKnotCount, 
   GLfloat *sKnots, 
   GLint tKnotCount, 
   GLfloat *tKnots, 
   GLint sStride, 
   GLint tStride, 
   GLfloat *control, 
   GLint sOrder, 
   GLint tOrder, 
   GLenum type)

Description

The gluNurbsSurface subroutine is used within a NURBS surface definition to describe the shape of a NURBS surface before trimming. To mark the beginning and end of a NURBS surface definition, use the gluBeginSurface and gluEndSurface commands.

Note: Call the gluNurbsSurface subroutine within a NURBS surface definition only.

Positional, texture, and color coordinates are associated with a surface by presenting each as a separate gluNurbsSurface statement between a gluBeginSurface and gluEndSurface pair. Each gluBeginSurface and gluEndSurface pair can contain no more than one call to gluNurbsSurface for each color, position, and texture data. One (and only one) call must be made to describe the position of the surface. (The Type parameter must be either GL_MAP2_VERTEX_3 or GL_MAP2_VERTEX_4.)

A NURBS surface can be trimmed using the gluNurbsCurve and gluPwlCurve subroutines within calls to gluBeginTrim and gluEndTrim.

Note: A gluNurbsSurface with sKnotCount knots in the u direction and tKnotCount knots in the v direction with the sOrder and tOrder orders must have control points equal to (sKnotCount - sOrder) x (tKnotCount - tOrder).

Parameters

nurb Specifies the NURBS object created with the gluNewNurbsRenderer subroutine.
sKnotCount Specifies the number of knots in the parametric U direction.
sKnots Specifies an array of non-decreasing sKnotCount values in the parametric U direction
tKnotCount Specifies the number of knots in the parametric V direction.
tKnots Specifies an array of non-decreasing tKnotCount values in the parametric V direction.
sStride Specifies the offset (as a number of single-precision floating-point values) between successive control points in the parametric U direction in control.
tStride Specifies the offset (in single-precision floating-point values) between successive control points in the parametric V direction in control.
control Specifies 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 sStride and tStride.
sOrder Specifies the order of the NURBS surface in the parametric u direction. The order is one more than the degree; therefore, a surface that is cubic in u has a u order of 4.
tOrder Specifies the order of the NURBS surface in the parametric v direction. The order is one more than the degree; therefore, a surface that is cubic in v has a v order of 4.
type Specifies the surface type. This value must be one of the valid 2-dimensional evaluators (such as GL_MAP2_VERTEX_3 or GL_MAP2_COLOR_4).

Examples

The following commands 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);

Files

/usr/include/GL/gl.h Contains C language constraints, variable type definitions, and ANSI function prototypes for OpenGL.

Related Information

The gluBeginSurface subroutine, gluBeginTrim subroutine, gluNewNurbsRenderer subroutine, gluNurbsCurve subroutine, gluPwlCurve subroutine.

OpenGL Overview.


[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]