Porting NURBS Curves

The OpenGL functions for drawing NURBS curves are very similar to the IRIS GL functions. You specify knot sequences and control points using a gluNurbsCurve function, which must be contained within a gluBeginCurve/gluEndCurve pair.

The following table lists the IRIS GL functions for drawing NURBS curves and their equivalent OpenGL functions.

IRIS GL Function OpenGL Function Meaning
bgncurve gluBeginCurve Begin a curve definition.
nurbscurve gluNurbsCurve Specify curve attributes.
endcurve gluEndCurve End a curve definition.

Associate position, texture, and color coordinates by presenting each as a separate gluNurbsCurve inside the begin/end pair. You can make no more than one call to gluNurbsCurve for each piece of color, position, and texture data within a single gluBeginCurve/gluEndCurve pair. You must make exactly one call to describe the position of the curve (a GL_MAP1_VERTEX_3 or GL_MAP1_VERTEX_4 description). When you call gluEndCurve, the curve is tessellated into line segments and then rendered.

The following table lists IRIS GL and OpenGL NURBS curve types.

IRIS GL Type OpenGL Type Meaning
N_V3D GL_MAP1_VERTEX_3 Polynomial curve.
N_V3DR GL_MAP1_VERTEX_4 Rational curve.
GL_MAP1_TEXTURE_COORD_* Control points are texture coordinates.
GL_MAP1_NORMAL Control points are normals.

For more information on available evaluator types, see glMap1.