HOpenGL Libraries (GLUT package)Source codeContentsIndex
Graphics.UI.GLUT.Objects
Portabilityportable
Stabilitystable
Maintainersven.panne@aedion.de
Contents
Rendering flavour
Object description
Type synonyms
Rendering
Description
GLUT includes a number of routines for generating easily recognizable 3D geometric objects. These routines reflect functionality available in the aux toolkit described in the OpenGL Programmer's Guide and are included in GLUT to allow the construction of simple GLUT programs that render recognizable objects. These routines can be implemented as pure OpenGL rendering routines. The routines do not generate display lists for the objects they create. The routines generate normals appropriate for lighting but do not generate texture coordinates (except for the teapot).
Synopsis
data Flavour
= Solid
| Wireframe
data Object
= Cube Height
| Dodecahedron
| Icosahedron
| Octahedron
| Tetrahedron
| RhombicDodecahedron
| Sphere' Radius Slices Stacks
| Cone Radius Height Slices Stacks
| Cylinder' Radius Height Slices Stacks
| Torus Radius Radius Sides Rings
| Teapot Height
| SierpinskiSponge NumLevels
type Sides = GLint
type Rings = GLint
type NumLevels = GLint
renderObject :: Flavour -> Object -> IO ()
Rendering flavour
data Flavour
Flavour of object rendering
Constructors
SolidObject is rendered as a solid with shading and surface normals.
WireframeObject is rendered as a wireframe without surface normals.
show/hide Instances
Object description
data Object

GLUT offers five types of objects:

Constructors
Cube HeightA cube centered at the modeling coordinates origin with sides of the given length.
DodecahedronA dodecahedron (12-sided regular solid) centered at the modeling coordinates origin with a radius of sqrt 3.
IcosahedronA icosahedron (20-sided regular solid) centered at the modeling coordinates origin with a radius of 1.0.
OctahedronRender a solid octahedron (8-sided regular solid) centered at the modeling coordinates origin with a radius of 1.0.
TetrahedronRender a solid tetrahedron (4-sided regular solid) centered at the modeling coordinates origin with a radius of sqrt 3.
RhombicDodecahedron(freeglut only) A rhombic dodecahedron whose corners are at most a distance of one from the origin. The rhombic dodecahedron has faces which are identical rhombi, but which have some vertices at which three faces meet and some vertices at which four faces meet. The length of each side is (sqrt 3)/2. Vertices at which four faces meet are found at (0, 0, +/-1) and (+/-(sqrt 2)/2, +/-(sqrt 2)/2, 0).
Sphere' Radius Slices StacksA sphere centered at the modeling coordinates origin of the specified radius. The sphere is subdivided around the Z axis into slices (similar to lines of longitude) and along the Z axis into stacks (similar to lines of latitude).
Cone Radius Height Slices StacksA cone oriented along the Z axis. The base of the cone is placed at Z = 0, and the top at Z = the given height. The cone is subdivided around the Z axis into slices, and along the Z axis into stacks.
Cylinder' Radius Height Slices Stacks(freeglut only) A cylinder oriented along the Z axis. The base of the cylinder is placed at Z = 0, and the top at Z = the given height. The cylinder is subdivided around the Z axis into slices, and along the Z axis into stacks.
Torus Radius Radius Sides RingsA torus (doughnut) centered at the modeling coordinates origin whose axis is aligned with the Z axis. The torus is described by its inner and outer radius, the number of sides for each radial section, and the number of radial divisions (rings).
Teapot HeightA teapot with a given relative size.
SierpinskiSponge NumLevels(freeglut only) A Sierpinski sponge of a given level, where a level 0 sponge is the same as a Tetrahedron.
show/hide Instances
Type synonyms
type Sides = GLint
type Rings = GLint
type NumLevels = GLint
Rendering
renderObject :: Flavour -> Object -> IO ()
Render an object in the given flavour.
Produced by Haddock version 0.8