[ Previous | Next | Contents | Glossary | Home | Search ]
OpenGL 1.1 for AIX: Reference Manual

gluNurbsCurve Subroutine


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


OpenGL C bindings library: libGL.a

C Syntax

void gluNurbsCurve(GLUnurbsObj *nobj, 
   GLint NumberOfKnots, 
   GLfloat *KnotArray, 
   GLint Stride, 
   GLfloat *ControlArray, 
   GLfloat Order, GLenum Type)


Use the gluNurbsCurve subroutine to describe a NURBS curve. When this subroutine is displayed between a gluBeginCurve and gluEndCurve pair, it describes a curve to be rendered. Positional, texture, and color coordinates are established by presenting each as a separate gluNurbsCurve statement between gluBeginCurve and gluEndCurve pairs. No more than one call to gluNurbsCurve for each color, position, or texture data can be made within a single gluBeginCurve and gluEndCurve pair. Exactly one call must be made to describe the position of the curve (a type of GL_MAP1_VERTEX_3 or GL_MAP1_VERTEX_4 description).

When a gluNurbsCurve subroutine is displayed between a gluBeginTrim and gluEndTrim pair, it describes a trimming curve on a NURBS surface. If the Type parameter is GLU_MAP1_TRIM_2, it describes a curve in 2-dimensional (2D) (u and v) parameter space. If the Type parameter is GLU_MAP1_TRIM_3, it describes a curve in 2D homogeneous (u, v, and w) parameter space. (See the gluBeginTrim subroutine for more information about trimming curves.)


nobj Specifies the NURBS object created with the gluNewNurbsRenderer subroutine.
NumberOfKnots Specifies the number of knots defined in the KnotArray parameter. NumberOfKnots should equal the number of control points plus the order.
KnotArray Specifies an array of nondecreasing knot values, as reflected by the NumberOfKnots parameter.
Stride Defines the offset (as a number of single-precision floating-point values) between successive curve control points.
ControlArray Specifies a pointer to an array of control points. These coordinates must agree with the Type parameter.
Order Specifies the order of the NURBS curve. Order equals degree + 1, meaning that a cubic curve has an order of 4.
Type Indicates the type of the curve. If the curve is defined within a gluBeginCurve/gluEndCurve pair, the type may be any of the valid 1-dimensional evaluator type (such as GL_MAP1_VERTEX_3 or GL_MAP1_COLOR_4). If it is between a gluBeginTrim/gluEndTrim pair, the only valid types are GLU_MAP1_TRIM_2 or GLU_MAP1_TRIM_3.


The following commands render a textured NURBS curve with normals:

    gluNurbsCurve(nobj, ..., GL_MAP1_TEXTURE_COORD_2);
    gluNurbsCurve(nobj, ..., GL_MAP1_NORMAL);
    gluNurbsCurve(nobj, ..., GL_MAP1_VERTEX_4);


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

Related Information

The gluBeginCurve subroutine, gluBeginTrim subroutine, gluNewNurbsRenderer subroutine, gluPwlCurve subroutine.

OpenGL Overview.

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