[ Previous | Next | Contents | Glossary | Home | Search ]
OpenGL 1.1 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(GLUnurbsObj *nobj, 
GLint UKnotCount, GLfloat *UKnotArray, 
GLint VKnotCount, GLfloat *VKnotArray, 
GLint UStride, GLint VStride, GLfloat *ControlArray, 
GLint UOrder, GLint VOrder, 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 UKnotCount knots in the U direction and VKnotCount knots in the V direction with the UOrder and VOrder orders must have control points equal to (UKnotCount - UOrder) x (VKnotCount - VOrder).

Parameters

nobj Specifies the NURBS object created with the gluNewNurbsRenderer subroutine.
UKnotCount Specifies the number of knots in the parametric U direction.
UKnotArray Specifies an array of non-decreasing UKnotCount values in the parametric U direction
VKnotCount Specifies the number of knots in the parametric V direction.
VKnotArray Specifies an array of non-decreasing VKnotCount values in the parametric V direction.
UStride Specifies the offset (as a number of single-precision floating-point values) between successive control points in the parametric U direction in ControlArray.
VStride Specifies the offset (in single-precision floating-point values) between successive control points in the parametric V direction in ControlArray.
ControlArray 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 UStride and VStride.
UOrder 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.
VOrder 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.


[ Previous | Next | Contents | Glossary | Home | Search ]