Open GL Super Bible:Curves and Surfaces: What the #%@!&* Are NURBS?
To access the contents, click the chapter and section titles.
Open GL Super Bible
(Publisher: Macmillan Computer Publishing)
Author(s): Waite group Press
ISBN: 1571690735
Publication Date: 08/01/96
Previous Table of Contents Next
gluNewNurbsRenderer
Purpose Creates a NURBS object. Include File <glu.h> Syntax GLUnurbsObj* gluNewNurbsRenderer(void); Description This function creates a NURBS rendering object. This object is used to control the behavior and characteristics of NURBS curves and surfaces. The functions that allow the NURBS properties to be set all require this pointer. You must delete this object with gluDeleteNurbsRenderer when you are finished rendering your NURBS. Returns A pointer to a new NURBS object. This object will be used when you call the rendering and control functions.
Example This code demonstrates the creation of a NURBS object:
// Setup the Nurbs object
// Start by creating it pNurb = gluNewNurbsRenderer();
// Set NURBS properties gluNurbsProperty(pNurb, GLU_SAMPLING_TOLERANCE, 25.0f); gluNurbsProperty(pNurb, GLU_DISPLAY_MODE, (GLfloat)GLU_FILL);
.. other properties
See Also gluDeleteNurbsRenderer
gluNurbsCallback
Purpose Defines a callback for a NURBS function. Include File <glu.h> Syntax void gluNurbsCallback(GLUnurbsObj *nObj, GLenum which, void (*fn)( )); Description This function sets a NURBS callback function. The only supported callback is GL_ERROR. When an error occurs, this function is called with an argument of type GLenum. One of 37 NURBS errors can be specified by the defines GLU_NURBS_ERROR1 - GLU_NURBS_ERROR37. A character string definition of the error can be retrieved with the function gluErrorString(). These are listed in Table 17-1.
Parameters
nObj
GLUnurbsObj*: Specifies the NURBS object. which
GLEnum: Specifies the callback being defined. The only valid value is GLU_ERROR. fn
void *(): Specifies the function that should be called for the callback. Returns None.
Example The following is an example error handler for NURBS errors. Some code that installs the error handler is also shown. You can see this in the NURBS example program.