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:
- Use gluNewNurbsRenderer() to create a pointer to a NURBS object,
which is referred to when creating your NURBS curve or surface.
- 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.
- Call gluNurbsCallback() if you want to be notified when an error
is encountered.
- Start your curve or surface by calling gluBeginCurve() or gluBeginSurface().
- 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.
- Call gluEndCurve() or gluEndSurface() to complete the
curve or surface.