Open GL Super Bible

Previous Table of Contents Next


Reference Section

gluCylinder

Purpose
Draws a quadric cylinder.
Include File
<GL/glu.h>
Syntax
void gluCylinder(GLUquadricObj *obj, GLdouble baseRadius, GLdouble topRadius, GLdouble height, GLint slices, GLint stacks);
Description
This function draws a hollow cylinder with no ends along the z-axis. If topRadius or bottomRadius is 0, a cone is drawn instead. The cylinder is projected height units along the positive z-axis. The slices argument controls the number of sides along the cylinder. The stacks argument controls the number of segments along the z-axis (across the cylinder) that are generated.

Parameters

obj
GLUquadricObj *: The quadric state information to use for rendering.
baseRadius
GLdouble: The radius of the base (Z=0) of the cylinder.
topRadius
GLdouble: The radius of the top (Z=height) of the cylinder.
height
GLdouble: The height or length of the cylinder along the z-axis.
slices
GLint: The number of sides on the cylinder.
stacks
GLint: The number of segments in the cylinder along the z-axis.
Returns
None.
Example
See the example in CH13\PENCIL.C.
See Also
gluDeleteQuadric, gluNewQuadric, gluQuadricCallback, gluQuadricDrawStyle, gluQuadricNormals, gluQuadricOrientation, gluQuadricTexture

gluDeleteQuadric

Purpose
Deletes a quadric state object.
Include File
<GL/glu.h>
Syntax
void gluDeleteQuadric(GLUquadricObj *obj);
Description
This function deletes a quadric state object. Once an object has been deleted it cannot be used for drawing again.

Parameters

obj
GLUquadricObj *: The quadric state object to delete.
Returns
None.
See Also
gluNewQuadric, gluQuadricCallback, gluQuadricDrawStyle, gluQuadricNormals, gluQuadricOrientation, gluQuadricTexture

gluDisk

Purpose
Draws a quadric disk.
Include File
<GL/glu.h>
Syntax
void gluDisk(GLUquadricObj *obj, GLdouble innerRadius, GLdouble outerRadius, GLint slices, GLint loops);
Description
This function draws a disk perpendicular to the z-axis. If innerRadius is 0, a solid (filled) circle is drawn instead of a washer. The slices argument controls the number of sides on the disk. The loops argument controls the number of rings generated out from the z-axis.

Parameters

obj
GLUquadricObj *: The quadric state information to use for rendering.
innerRadius
GLdouble: The inside radius of the disk.
outerRadius
GLdouble: The outside radius of the disk.
slices
GLint: The number of sides on the cylinder.
loops
GLint: The number of rings out from the z-axis.
Returns
None.
See Also
gluDeleteQuadric, gluNewQuadric, gluQuadricCallback, gluQuadricDrawStyle, gluQuadricNormals, gluQuadricOrientation, gluQuadricTexture

gluNewQuadric

Purpose
Creates a new quadric state object.
Include File
<GL/glu.h>
Syntax
GLUquadricObj *gluNewQuadric(void);
Description
This function creates a new opaque quadric state object to be used for drawing. The quadric state object contains specifications that determine how subsequent images will be drawn.
Parameters
None.
Returns
GLUquadricObj *: NULL if no memory is available; otherwise, a valid quadric state object pointer.
Example
See the example in CH13\PENCIL.C.
See Also
gluDeleteQuadric, gluQuadricCallback, gluQuadricDrawStyle, gluQuadricNormals, gluQuadricOrientation, gluQuadricTexture

gluPartialDisk

Purpose
Draws a partial quadric disk.
Include File
<GL/glu.h>
Syntax
void gluPartialDisk(GLUquadricObj *obj, GLdouble innerRadius, GLdouble outerRadius, GLint slices, GLint loops, GLdouble startAngle, GLdouble sweepAngle);
Description
This function draws a partial disk perpendicular to the z-axis. If innerRadius is 0, a solid (filled) circle is drawn instead of a washer. The slices argument controls the number of sides on the disk. The loops argument controls the number of rings out from the z-axis that are generated. The startAngle argument specifies the starting angle of the disk with 0? at the top of the disk and 90? at the right of the disk. The sweepAngle argument specifies the portion of the disk in degrees.

Parameters

obj
GLUquadricObj *: The quadric state information to use for rendering.
innerRadius
GLdouble: The inside radius of the disk.
outerRadius
GLdouble: The outside radius of the disk.
slices
GLint: The number of sides on the cylinder.
loops
GLint: The number of rings out from the z-axis.
startAngle
GLdouble: The start angle of the partial disk.
sweepAngle
GLdouble: The angular size of the partial disk.
Returns
None.
See Also
gluDeleteQuadric, gluNewQuadric, gluQuadricCallback, gluQuadricDrawStyle, gluQuadricNormals, gluQuadricOrientation, gluQuadricTexture


Previous Table of Contents Next