Contents / Previous / Next


GLU Functions to Manage Quadric Objects

GLUquadricObj* gluNewQuadric (void);
void gluDeleteQuadric (GLUquadricObj *state);
void gluQuadricCallback (GLUquadricObj *qobj, GLenum which, void (*fn)());

Control the rendering:
void gluQuadricNormals (GLUquadricObj *quadObject, GLenum normals);
void gluQuadricTexture (GLUquadricObj *quadObject, GLboolean textureCoords);
void gluQuadricOrientation (GLUquadricObj *quadObject, GLenum orientation);
void gluQuadricDrawStyle (GLUquadricObj *quadObject, GLenum drawStyle);

Specify a quadric primitive:

void gluCylinder( GLUquadricObj *qobj, GLdouble baseRadius,
                  GLdouble topRadius, GLdouble height, 
		  GLint slices, GLint stacks );

void gluDisk( GLUquadricObj *qobj, GLdouble innerRadius,
              GLdouble outerRadius, 
	      GLint slices, GLint loops );

void gluPartialDisk( GLUquadricObj *qobj, GLdouble innerRadius,
                     GLdouble outerRadius, GLint slices, GLint loops,
		     GLdouble startAngle, GLdouble sweepAngle );

void gluSphere( GLUquadricObj *qobj, GLdouble radius, 
                GLint slices, GLint stacks );


Control Quadrics Attributes

The drawStyle parameter in gluQuadricDrawStyle() controls the rendering style. Legal values for drawStyle are GLU_POINT, GLU_LINE, GLU_SILHOUETTE, and GLU_FILL.
GLU_SILHOUETTE specifies that primitives are rendered as lines, except that edges separating coplanar faces are not drawn. This is most often used for gluDisk() and gluPartialDisk().
GLU_FILL specifies rendering by filled polygons, where the polygons are drawn in a counterclockwise fashion with respect to their normals. This may be affected by gluQuadricOrientation(), orientation is either GLU_OUTSIDE (the default) or GLU_INSIDE.

gluQuadricNormals() is used to specify when to generate normal vectors. GLU_NONE means that no normals are generated and is intended for use without lighting. GLU_FLAT generates one normal for each facet, which is often best for lighting with flat shading. GLU_SMOOTH generates one normal for every vertex of the quadric, which is usually best for lighting with smooth shading.

In gluQuadricTexture() textureCoords is either GL_FALSE (the default) or GL_TRUE. If the value of textureCoords is GL_TRUE, then texture coordinates are generated for the quadrics object.