C481 B581 Computer Graphics
Dana Vrajitoru
Complex Geometrical Objects in OpenGL
Quadric Objects in GLU
-
Quadric: geometrical form defined by equations in x, y, and z, of degree
<
2.
-
x2 + y2 + z2 = 4
-
In GLU, one must declare such an object and define its rendering mode.
GLUquadricObj *obj = gluNewQuadric();
gluQuadricDrawStyle(obj, GLU_LINE);
-
The style can be GLU_FILL , GLU_LINE , GLU_POINT or GLU_SILHOUETTE.
Quadric Primitives
void gluSphere( GLUquadricObj *quadobj, GLdouble radius, GLint
slices, GLint stacks );
void gluCylinder( GLUquadricObj *quadobj, GLdouble baseRadius,
GLdouble topRadius, GLdouble height, GLint slices, GLint stacks );
void gluDisk( GLUquadricObj *quadobj, GLdouble innerRadius, GLdouble
outerRadius, GLint slices, GLint loops );
void gluPartialDisk( GLUquadricObj *quadobj, GLdouble innerRadius,
GLdouble outerRadius, GLint slices, GLint loops, GLdouble startAngle, GLdouble
sweepAngle );

A cylinder and a disk.
Complex Objects in GLUT
glutSolidSphere(radius, slices, stacks);
glutWireSphere(...);
The objects can be Cube, Cone, Torus, Dodecahedron, Octahedron, Tetrahedron,
Icosahedron, Teapot,
Documentation for each of them can be found at
http://www.openGL.org/

The teapot and a dodecaedron