[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]
OpenGL 1.2 for AIX: Reference Manual

gluDisk Subroutine

Purpose

Draws a disk.

Library

OpenGL C bindings library: libGL.a

C Syntax

void gluDisk(GLquadric* quad, 
   GLdouble inner, 
   GLdouble outer, 
   GLint slices, 
   GLint loops)

Description

The gluDisk subroutine renders a disk on the z=0 plane. The disk has a radius defined by the outer parameter and contains a concentric circular hole with a radius defined by the inner parameter. If the value of inner is 0, no hole is generated. The disk is subdivided around the z axis into slices and rings (as specified by the slices and loops parameters, respectively).

With regard to orientation, the +z side of the disk is considered to be outside. (See the gluQuadricOrientation subroutine for details on specifying quadrics orientation.) If orientation is set to GLU_OUTSIDE, any normals generated point along the +z axis. Otherwise, they point along the -z axis.

If texturing is turned on with the gluQuadricTexture subroutine, texture coordinates are generated linearly, consistent with the following table:

XYZ Coordinates  (u, v) Texture Coordinates
(outer, 0.0, 0.0) (1.0, 0.5)
(0.0, outer, 0.0) (0.5, 1.0)
(-outer, 0.0, 0.0) (0.5, 0.0)

The formulae are:

texture coordinate u = 0.5 + 0.5 * (x/outer)
texture coordinate v = 0.5 + 0.5 * (y/outer)

Parameters

quad Specifies the quadrics object created with the gluNewQuadric subroutine.
inner Defines the inner radius of the disk (may be 0).
outer Defines the outer radius of the disk.
slices Specifies the number of desired subdivisions around the z axis.
loops Specifies the number of desired concentric rings about the origin into which the disk is subdivided.

Files

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

Related Information

The gluCylinder subroutine, gluNewQuadric subroutine, gluPartialDisk subroutine, gluQuadricOrientation subroutine, gluQuadricTexture subroutine, gluSphere subroutine.

OpenGL Overview.


[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]