Defines the shape of a non-uniform rational B-spline (NURBS) curve.
OpenGL C bindings library: libGL.a
void gluNurbsCurve(GLUnurbs* nurb, GLint knotCount, GLfloat *knots, GLint stride, GLfloat *control, GLint 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.)
The following commands render a textured NURBS curve with normals:
gluBeginCurve(nobj); gluNurbsCurve(nobj, ..., GL_MAP1_TEXTURE_COORD_2); gluNurbsCurve(nobj, ..., GL_MAP1_NORMAL); gluNurbsCurve(nobj, ..., GL_MAP1_VERTEX_4); gluEndCurve(nobj);
/usr/include/GL/gl.h | Contains C language constraints, variable type definitions, and ANSI function prototypes for OpenGL. |
Note: To define trim curves which stitch well, use gluPwlCurve.
The gluBeginCurve subroutine, gluBeginTrim subroutine, gluNewNurbsRenderer subroutine, gluPwlCurve subroutine.