[ Previous | Next | Contents | Glossary | Home | Search ]
OpenGL 1.1 for AIX: Reference Manual

gluNurbsProperty Subroutine

Purpose

Sets a non-uniform rational B-spline (NURBS) property.

Library

OpenGL C bindings library: libGL.a

C Syntax

void gluNurbsProperty(GLUnurbs* nobj, 
   GLenum Property, 
   GLfloat Value)

Description

The gluNurbsProperty subroutine adjusts properties stored in a NURBS object. These properties affect the way that NURBS curves are rendered. Adjustments are made through the Property and Value parameters. The following values are valid for the Property parameter:

GLU_SAMPLING_METHOD Value Specifies how a NURBS surface should be tessellated. The value parameter may be one of GLU_PATH_LENGTH, GLU_PARAMETRIC_ERROR, or GLU_DOMAIN_DISTANCE. When set to GLU_PATH_LENGTH, the surface is rendered so that the maximum length, in pixels, of the edges of the tessellation polygons is no greater than what is specified by GLU_SAMPLING_TOLERANCE. The initial value of GLU_SAMPLING_METHOD is GLU_PATH_LENGTH
GLU_PARAMETRIC_ERROR Specifies that the surface is rendered in such a way that the value specified by GLU_PARAMETRIC_TOLERANCE describes the maximum distance, in pixels, between the tessellation polygons and the surfaces they approximate.
GLU_PARAMETRIC_TOLERANCE Value The Value parameter specifies the maximum distance, in pixels, to use when the sampling method is GLU_PARAMETRIC_ERROR. The initial value is 0.5.
GLU_DOMAIN_DISTANCE Value Allows users to specify, in parametric coordinates, how many sample points per unit length are taken in u, v direction.
GLU_SAMPLING_TOLERANCE Value The Value parameter specifies the maximum length, in pixels, of line segments or edges of polygons used to render NURBS curves or surfaces. The NURBS code is conservative when rendering a curve or surface, so the actual length can be somewhat shorter. The default value is 50.0 pixels.
GLU_U_STEP Value The Value parameter specifies the number of sample points per unit length taken along the u axis in parametric coordinates. It is needed when GLU_SAMPLING_METHOD is set to GLU_DOMAIN_DISTANCE. The initial value is 100.
GLU_V_STEP Value The Value parameter specifies the number of sample points per unit length taken along the v axis in parametric coordinates. It is needed when GLU_SAMPLING_METHOD is set to GLU_DOMAIN_DISTANCE. The initial value is 100
GLU_DISPLAY_MODE Value The Value parameter defines how a NURBS surface should be rendered. The Value parameter can be set to the following:
  • GLU_FILL
  • GLU_OUTLINE_POLYGON
  • GLU_OUTLINE_PATCH

Only one of these values can be used. GLU_FILL causes the surface to be rendered as a set of polygons. GLU_OUTLINE_POLYGON instructs the NURBS library to draw only the outlines of the polygons created by tessellation. GLU_OUTLINE_PATCH causes just the outlines of patches and trim curves defined by the user to be drawn. The default value is GLU_FILL.
                          
GLU_CULLING Value The Value parameter is a Boolean value that, when set to GL_TRUE, indicates that a NURBS curve should be discarded prior to tessellation if its control points lie outside the current viewport. The default is GL_FALSE, because a NURBS curve need not fall entirely within the convex hull of its control points.
GLU_AUTO_LOAD_MATRIX Value The Value parameter is a Boolean value that, when set to GL_TRUE, causes the NURBS code to download the projection matrix, the modelview matrix, and the 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, the user must provide a projection matrix, a modelview matrix, and a viewport for the NURBS renderer to use to construct sampling and culling matrices. This can be done with the gluLoadSamplingMatrices subroutine. 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 gluLoadSamplingMatrices is called.

Parameters

nobj Specifies the NURBS object created with the gluNewNurbsRenderer subroutine.
Property Specifies the name of 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
  • GLU_V_STEP
Value Specifies the value to which the indicated property is set. Value may be a numeric value or one of the following:
  • GLU_PATH_LENGTH
  • GLU_PARAMETRIC_ERROR
  • GLU_DOMAIN_DISTANCE

Notes

If GLU_AUTO_LOAD_MATRIX is true, sampling and culling may be executed incorrectly if NURBS routines are compiled into a display list.

A property of GLU_PARAMETRIC_TOLERANCE, GLU_SAMPLING_METHOD, GLU_U_STEP, or GLU_V_STEP, or a value of GLU_PATH_LENGTH, GLU_PARAMETRIC_ERROR, GLU_DOMAIN_DISTANCE are only available if the GLU version is 1.1 or greater. They are not valid parameters in GLU 1.0.

Use the gluGetString subroutine to determine the GLU version.

Files

/usr/include/GL/gl.h Contains C language constraints, variable type definitions, and ANSI function prototypes for OpenGL.

Related Information

The gluGetNurbsProperty subroutine, gluLoadSamplingMatrices subroutine, gluNewNurbsRenderer subroutine, gluGetString subroutine.

OpenGL Overview.


[ Previous | Next | Contents | Glossary | Home | Search ]