Rendering Simple Surfaces

The GLU library includes a set of functions for drawing various simple surfaces (spheres, cylinders, disks, and parts of disks) in a variety of styles and orientations. These functions are described in detail in the OpenGL Reference Manual.

    To render simple surfaces
  1. Create a quadric object with gluNewQuadric.

    To destroy this object when you're finished with it, use gluDeleteQuadric.

  2. Specify the desired rendering style, as listed below, with the appropriate function (unless you're satisfied with the default values):
  3. After specifying the rendering style, invoke the rendering function for the desired type of quadric object: gluSphere, gluCylinder, gluDisk, or gluPartialDisk.

    If an error occurs during rendering, the error-handling function you've specified with gluQuadricCallBack is invoked.

Use the *Radius, height, and similar arguments, rather than the glScale function, to scale the quadrics, so that you don't have to renormalize any unit-length normals that are generated. To force lighting calculations at a finer granularity, especially if the material specularity is high, set the loops and stacks arguments to values other than 1.