GLU Quadrics

Quadrics are various smooth surfaces that can be described by the generic quadratic equation:

a1 x2 + a2 y2 + a3 z2 + a4 xy + a5 yz + a6 xz + a7 x + a8 y + a9 z + a10 = 0

The basic quadric shapes are spheres, cylinders, cones, and disks.

To draw a quadric, create a "quadric object" and then pass it to the appropriate GLU function. There are functions to control how a quadric is drawn - with points, lines, or polygons; with or without lighting; with or without texturing.

quadric = gluNewQuadric()

gluQuadricDrawStyle(quadric, GLU_LINE)

gluSphere(quadric, 2.5, 32, 24)

Example code: gluQuadrics.py

Sphere gluSphere(quadric, radius, slices, stacks)
Cylinder gluCylinder(quadric, baseRadius, topRadius, height, slices, stacks)
(a cone is a cylinder with one radius = 0)
Disk gluDisk(quadric, innerRadius, outerRadius, slices, rings)
Partial Disk gluPartialDisk(quadric, innerRadius, outerRadius, slices, rings, startAngle, sweepAngle)

next