Contents / Previous / Next


The GLU NURBS Interface

The GLU provides a NURBS (Non-Uniform Rational B-Spline) interface built on top of the OpenGL evaluator commands.

Writing OpenGL code to manipulate NURBS curves and surfaces is relatively easy,
even with lighting and texture mapping:

  1. Use gluNewNurbsRenderer() to create a pointer to a NURBS object,
    which is referred to when creating your NURBS curve or surface.

  2. If desired, call gluNurbsProperty() to choose rendering values,
    such as the maximum size of lines or polygons that are used to render your NURBS object.

  3. Call gluNurbsCallback() if you want to be notified when an error is encountered.

  4. Start your curve or surface by calling gluBeginCurve() or gluBeginSurface().

  5. Generate and render your curve or surface. Call gluNurbsCurve() or gluNurbsSurface() at least once with the control points (rational or nonrational), knot sequence, and order of the polynomial basis function for your NURBS object. You might call these functions additional times to specify surface normals and/or texture coordinates.

  6. Call gluEndCurve() or gluEndSurface() to complete the curve or surface.