The gluNurbsProperty function sets a NURBS property.
void gluNurbsProperty( GLUnurbsObj *nobj, GLenum property, GLfloat value );
- The NURBS object (created with gluNewNurbsRenderer).
- The property to be set. The following values are valid: GLU_SAMPLING_TOLERANCE, GLU_DISPLAY_MODE, GLU_CULLING, GLU_AUTO_LOAD_MATRIX, GLU_PARAMETRIC_TOLERANCE, GLU_SAMPLING_METHOD, GLU_U_STEP, and GLU_V_STEP. For the meaning of these values, see the following Remarks section.
- The value to which to set the indicated property. The value parameter can be a numeric value or one of the following three values: GLU_PATH_LENGTH, GLU_PARAMETRIC_ERROR, or GLU_DOMAIN_DISTANCE. For the meaning of these values, see the following Remarks section.
Use gluNurbsProperty to control properties stored in a NURBS object. These properties affect the way a NURBS curve is rendered. The valid values for property are as follows:
- Specifies the maximum length, in pixels, to use when the sampling method is set to GLU_PATH_LENGTH. The default value is 50.0 pixels.
- The value parameter defines how a NURBS surface is to be rendered. You can set value to GLU_FILL, GLU_OUTLINE_POLYGON, or GLU_OUTLINE_PATCH. The following table describes the results of these constants.
Constant Result GLU_FILL The surface is rendered as a set of polygons. This is the default value. GLU_OUTLINE_POLYGON The NURBS library draws only the outlines of the polygons created by tessellation. GLU_OUTLINE_PATCH Only the outlines of patches and trim curves defined by the user are drawn.
- The value parameter is a Boolean value. When value is set to GL_TRUE, NURBS curves whose control points lie outside the current viewport are discarded prior to tessellation. The default is GL_FALSE (because a NURBS curve cannot fall entirely within the convex hull of its control points).
- Specifies the maximum distance, in pixels, to use when the sampling method is set to GLU_PARAMETRIC_ERROR. The default value is 0.5.
- Specifies how to tessallate a NURBS surface. GLU_SAMPLING_METHOD can have one of the following three values.
Value Meaning GLU_PATH_LENGTH The default value. Specifies that surfaces rendered with the maximum length, in pixels, of the edges of the tessellation polygons are no greater than the value specified by GLU_SAMPLING_TOLERANCE. GLU_PARAMETRIC_ERROR Specifies that in rendering the surface, the value of GLU_PARAMETRIC_TOLERANCE specifies the maximum distance, in pixels, between the tessellation polygons and the surfaces they approximate. GLU_DOMAIN_DISTANCE Specifies, in parametric coordinates, how many sample points per unit length to take in the u and v dimensions.
- Specifies the number of sample points per unit length taken along the u dimension in parametric coordinates. The value of GLU_U_STEP is used when GLU_SAMPLING_METHOD is set to GLU_DOMAIN_DISTANCE. The default value is 100.
- Specifies the number of sample points per unit length taken along the v dimension in parametric coordinates. The value of GLU_V_STEP is used when GLU_SAMPLING_METHOD is set to GLU_DOMAIN_DISTANCE. The default value is 100.
- The value parameter is a Boolean value. When set to GL_TRUE, the NURBS code downloads the projection matrix, modelview matrix, and viewport from the OpenGL server to compute sampling and culling matrices for each NURBS curve that is rendered. Sampling and culling matrices are required to determine the tessellation of a NURBS surface into line segments or polygons and to cull a NURBS surface if it lies outside of the viewport. If this mode is set to GL_FALSE, you must provide a projection matrix, modelview matrix, and viewport for the NURBS renderer to use to construct sampling and culling matrices. You can do this with the gluLoadSamplingMatrices function. The default for this mode is GL_TRUE. Changing this mode from GL_TRUE to GL_FALSE does not affect the sampling and culling matrices until you call gluLoadSamplingMatrices.
Note The following property parameters are supported in GLU version 1.1 or later and are not valid for GLU version 1.0:
GLU_PARAMETRIC_TOLERANCE, GLU_SAMPLING_METHOD, GLU_U_STEP, and GLU_V_STEP.
The following value parameters are supported in GLU version 1.1 or later and are not valid for GLU version 1.0:
GLU_PATH_LENGTH, GLU_PARAMETRIC_ERROR, and GLU_DOMAIN_DISTANCE.
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.