Silicon Graphics

[Prev] [TOC] [Next]



(-) OpenGL Programming Guide
(-) Appendix EThe OpenGL Programming Guide Auxiliary Library

Initializing and Drawing Three-Dimensional Objects

Many sample programs in this guide use three-dimensional models to illustrate various rendering properties. The following drawing routines are included in the auxiliary library to avoid having to reproduce the code to draw these models in each program. Each three-dimensional model comes in two flavors: wireframe without surface normals, and solid with shading and surface normals. Use the solid version when you're applying lighting. The argument for these routines allows you to scale the object that's drawn. void auxWireSphere(GLdouble radius);
void auxSolidSphere(GLdouble radius);

void auxWireCube(GLdouble size);
void auxSolidCube(GLdouble size);

void auxWireBox(GLdouble width, GLdouble height, GLdouble depth);
void auxSolidBox(GLdouble width, GLdouble height, GLdouble depth);

void auxWireTorus(GLdouble innerRadius, GLdouble outerRadius);
void auxSolidTorus(GLdouble innerRadius, GLdouble outerRadius);

void auxWireCylinder(GLdouble radius, GLdouble height);
void auxSolidCylinder(GLdouble radius, GLdouble height);

void auxWireIcosahedron(GLdouble radius);
void auxSolidIcosahedron(GLdouble radius);

void auxWireOctahedron(GLdouble radius);
void auxSolidOctahedron(GLdouble radius);

void auxWireTetrahedron(GLdouble radius);
void auxSolidTetrahedron(GLdouble radius);

void auxWireDodecahedron(GLdouble radius);
void auxSolidDodecahedron(GLdouble radius);

void auxWireCone(GLdouble radius, GLdouble height);
void auxSolidCone(GLdouble radius, GLdouble height);

void auxWireTeapot(GLdouble size);
void auxSolidTeapot(GLdouble size);

Draws the specified wireframe or solid object. These routines are self-initializing; that is, the first time a rendering request is made, a display list is created for the object. Every subsequent time the routine is called, the same display list is executed. All these models are drawn centered at the origin. When drawn with unit scale factors, these models fit into a box with all coordinates from -1 to 1. Use the arguments for these routines to scale the objects.


[Prev] [TOC] [Next]

OpenGL Programming Guide


Maintained by Maintainer: Send e-mail to .htm">name@address.