Share via


gluNurbsCurve

The gluNurbsCurve function defines the shape of a NURBS curve.

void gluNurbsCurve(
  GLUnurbsObj *nobj,  GLint nknots,  GLfloat *knot,  GLint stride,  GLfloat *ctlarray,  GLint order,  GLenum type);

Parameters

  • nobj
    The NURBS object (created with gluNewNurbsRenderer).
  • nknots
    The number of knots in knot. The nknots parameter equals the number of control points plus the order.
  • knot
    An array of nknots nondecreasing knot values.
  • stride
    The offset (as a number of single precisionfloating-point values) between successive curve control points.
  • ctlarray
    A pointer to an array of control points. The coordinates must agree with type.
  • order
    The order of the NURBS curve. The order parameter equals degree + 1; hence a cubic curve has an order of 4.
  • type
    The type of the curve. If this curve is defined within a gluBeginCurve/gluEndCurve pair, then the type can be any of the valid one-dimensional evaluator types (such as GL_MAP1_VERTEX_3 or GL_MAP1_COLOR_4). Between a gluBeginTrim/gluEndTrim pair, the only valid types are GLU_MAP1_TRIM_2 and GLU_MAP1_TRIM_3.

Remarks

When gluNurbsCurve appears between a gluBeginCurve/gluEndCurve pair, it describes a curve to be rendered. You associate positional, texture, and color coordinates by presenting each as a separate gluNurbsCurve between a gluBeginCurve/gluEndCurve pair. Do not make more than one call to gluNurbsCurve for color, position, and texture data within a single gluBeginCurve/gluEndCurve pair. Make exactly one call to describe the position of the curve (a type of GL_MAP1_VERTEX_3 or GL_MAP1_VERTEX_4).

When gluNurbsCurve appears between a gluBeginTrim/gluEndTrim pair, it describes a trimming curve on a NURBS surface. If type is GLU_MAP1_TRIM_2, it describes a curve in two-dimensional (u and v) parameter space. If it is GLU_MAP1_TRIM_3, it describes a curve in two-dimensional homogeneous (u, v, and w) parameter space. For more discussion about trimming curves, see gluBeginTrim.

Example

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

Requirements

**  Windows NT/2000:** Requires Windows NT 3.5 or later.
**  Windows 95/98:** Requires Windows 95 or later. Available as a redistributable for Windows 95.
**  Header:** Declared in Glu.h.
**  Library:** Use Glu32.lib.

See Also

gluBeginCurve, gluBeginTrim, gluEndCurve, gluEndTrim, gluNewNurbsRenderer, gluPwlCurve