Programming and Graphics

(Kiana) #1

8.1 Glut 263


glutSolidSphere (double radius, int slices, int stacks)
glutWireSphere (double radius, int slices, int stacks)

glutSolidCone (double base, double height, int slices, int stacks)
glutWireCone (double base, double height, int slices, int stacks)

glutSolidCube (double size)
glutWireCube (double size)

glutSolidTorus (double innerRadius, double outerRadius,
int nsides, int rings)
glutWireTorus (double innerRadius, double outerRadius,
int nsides, int rings)
glutSolidDodecahedron()
glutWireDodecahedron()

glutSolidOctahedron()
glutWireOctahedron()

glutSolidTetrahedron()
glutWireTetrahedron()

glutSolidIcosahedron()
glutWireIcosahedron()

glutSolidTeapot (double size)
glutWireTeapot (double size)

Table 8.1.2Glutfunctions implementing prefabricated shapes.


//--- Body:

glColor3f(1.0f, 1.0f, 1.0f);
glutSolidSphere(0.5,20,20);

//--- Head:

glTranslatef(0.0,0.75,0.0);
glutSolidSphere(0.25,20,20);

//--- Eyes:

glPushMatrix();
Free download pdf