Functions
void
glutSolidCone (GLdouble base, GLdouble height, GLint slices, GLint stacks)
void
glutSolidCylinder (GLdouble radius, GLdouble height, GLint slices, GLint stacks)
void
glutSolidTorus (GLdouble dInnerRadius, GLdouble dOuterRadius, GLint nSides, GLint nRings)
void
glutWireCone (GLdouble base, GLdouble height, GLint slices, GLint stacks)
void
glutWireCylinder (GLdouble radius, GLdouble height, GLint slices, GLint stacks)
void
glutWireTorus (GLdouble dInnerRadius, GLdouble dOuterRadius, GLint nSides, GLint nRings)
Detailed Description
This subset of OpenGLUT provides some elementary objects that are more or less standard fare for computer graphics. The objects all provide coordinates and surface normals.
Function Documentation
void glutSolidCone
(
GLdouble
base,
GLdouble
height,
GLint
slices,
GLint
stacks
)
Draw a solid cone.
- Parameters:
-
base Cone radius at the base in the xy plane.
height Height of cone in positive z direction.
slices The number of divisions around the z axis. (latitudal)
stacks The number of divisions along the z axis. (longitudal)
The
glutSolidCone() function draws a shaded cone with a base in the xy-plane, oriented in the positive z direction.
- Note:
- The number of polygons representing the conical surface is proportional to (slices*stacks).
- See also:
- glutWireCone()
void glutSolidCube
(
GLdouble
width
)
Draw a solid cube centered at the origin.
- Parameters:
-
width The width, height and depth of the cube.
The
glutSolidCube() function draws a solid-shaded cube with side-length given by
width. The vertices of the cube are at (+/-
width/2, +/-
width/2, +/-
width/2), so that the cube is centered at the origin.
- Author:
- Code contributed by Andreas Umbach <marvin@dataway.ch>
- See also:
- glutWireCube()
void glutSolidCylinder
(
GLdouble
radius,
GLdouble
height,
GLint
slices,
GLint
stacks
)
Draw a solid cylinder.
- Parameters:
-
radius Radius of the cylinder.
height Z height.
slices Divisions around z axis.
stacks Divisions along z axis.
glutSolidCylinder() draws a shaded cylinder, the center of whose base is at the origin and whose axis is along the positive z axis.
- See also:
- glutWireCylinder()
void glutSolidDodecahedron
(
void
)
void glutSolidIcosahedron
(
void
)
Draw a solid icosahedron.
This function draws a regular, solid 20-sided polyhedron centered at the origin. The distance from the origin to the vertices is 1.
- See also:
- glutWireIcosahedron()
void glutSolidOctahedron
(
void
)
Draw a solid octahedron.
This function draws a regular, solid 8-sided polyhedron centered at the origin. The vertices are at (+/-1, 0, 0), (0, +/-1, 0), (0, 0, +/-1).
- Note:
- We visit the same vertices the same number of times as in the wire octahedron, but the order is different.
- See also:
- glutWireOctahedron()
void glutSolidRhombicDodecahedron
(
void
)
void glutSolidSierpinskiSponge
(
int
num_levels,
const GLdouble
offset[3],
GLdouble
scale
)
Draw a solid Spierspinski's sponge.
- Parameters:
-
num_levels Recursive depth.
offset Location vector.
scale Relative size.
This function recursively draws a few levels of a solid-shaded Sierpinski's Sponge. If
num_levels is 0, draws 1 tetrahedron. The
offset is a translation. The
z axis is normal to the base. The sponge is centered at the origin.
- Note:
- Runtime is exponential in num_levels .
- Todo:
- Consider removing the offset parameter from the API (use a helper function).
- See also:
- glutWireSierpinskiSponge()
void glutSolidSphere
(
GLdouble
radius,
GLint
slices,
GLint
stacks
)
Draw a solid sphere centered at the origin.
- Parameters:
-
radius Sphere radius.
slices The number of divisions around the z axis. (latitudal)
stacks The number of divisions along the z axis. (longitudal)
The
glutSolidSphere() function draws a shaded sphere centered at the origin. The surface is created from quadrangles (except for triangles as degenerate quads at the poles) in a longitude/latitude pattern. The equatorial great circle lies in the xy-plane and is centered on the origin.
- Note:
- The number of polygons representing the spherical surface is proportional to (slices*stacks).
- See also:
- glutWireSphere()
void glutSolidTeapot
(
GLdouble
size
)
Draw a solid teapot.
- Parameters:
-
size Scale factor.
Draws the standard Teapot, solid shaded, using OpenGL evaluators. This is the classic "Utah Teapot" of computer graphics. The base should lie in the xy-plane with "up" being along the positive z axis.
This is derived from SGI code. It should also be the same as the teapot modeled by Martin Newell in 1975.
- See also:
- glutWireTeapot()
void glutSolidTetrahedron
(
void
)
void glutSolidTorus
(
GLdouble
dInnerRadius,
GLdouble
dOuterRadius,
GLint
nSides,
GLint
nRings
)
Draw a solid torus.
- Parameters:
-
dInnerRadius Radius of ``tube''
dOuterRadius Radius of ``path''
nSides Facets around ``tube''
nRings Joints along ``path''
This function effectively wraps a cylinder with
nSides slats and bends it at
nRings facets around a circular path, forming a torus, or ``donut''. The center is at the origin and the ``path'' rings around the z axis.
The torus parameters can be explored interactively with the OpenGLUT shapes demo.
- Note:
- dInnerRadius and dOuterRadius are not analogous to similar measurements of an anulus.
- See also:
- glutWireTorus()
void glutWireCone
(
GLdouble
base,
GLdouble
height,
GLint
slices,
GLint
stacks
)
Draw a wireframe cone.
- Parameters:
-
base Cone radius at the base in the xy plane.
height Height of cone in positive z direction.
slices The number of divisions around the z axis. (latitudal)
stacks The number of divisions along the z axis. (longitudal)
The
glutWireCone() function draws a wireframe cone with a base in the xy plane oriented in positive z.
- Note:
- The number of line segments representing the conical surface is proportional to (slices*stacks).
- See also:
- glutSolidCone()
void glutWireCube
(
GLdouble
width
)
Draw a wireframe cube centered at the origin.
- Author:
- Code contributed by Andreas Umbach <marvin@dataway.ch>
- Parameters:
-
width The width, height and depth of the cube.
The
glutWireCube() function draws an axis-aligned wireframe cube with a specified width, height and depth. The vertices of the cube are at (+/-
width/2, +/-
width/2, +/-
width/2), so that the cube is centered at the origin.
- See also:
- glutSolidCube()
void glutWireCylinder
(
GLdouble
radius,
GLdouble
height,
GLint
slices,
GLint
stacks
)
Draw a wireframe cylinder.
- Parameters:
-
radius Radius of cylinder.
height Z height.
slices Number of divisions around the z axis.
stacks Number of divisions along the z axis.
glutWireCylinder() draws a wireframe of a cylinder, the center of whose base is at the origin, and whose axis parallels the z axis.
- See also:
- glutSolidCylinder()
void glutWireDodecahedron
(
void
)
void glutWireIcosahedron
(
void
)
Draw a wireframe icosahedron.
This function draws a regular, solid 20-sided polyhedron centered at the origin. The distance from the origin to the vertices is 1. No facet is normal to any of the x, y, or z axes.
- See also:
- glutSolidIcosahedron()
void glutWireOctahedron
(
void
)
Draw a wireframe octahedron.
This function draws a regular wireframe 8-sided polyhedron centered at the origin. The vertices are at (+/-1, 0, 0), (0, +/-1, 0), (0, 0, +/-1).
- Note:
- We visit the same vertices the same number of times as for the solid octahedron, but the order is different.
Draws every edge twice.
The lines have normals, but the normals are from the facets, rather than upon the edge. If you squint too hard, the lighting on a wireframe octahedron does not look quite right.
- Todo:
- It may be faster (and look better) to draw each edge once, setting the Normal at each edge. (I don't think that this matters all that much, but a lineloop was proposed for the wire Cube for speed.)
- See also:
- glutSolidOctahedron()
void glutWireRhombicDodecahedron
(
void
)
void glutWireSierpinskiSponge
(
int
num_levels,
const GLdouble
offset[3],
GLdouble
scale
)
Draw a wireframe Spierspinski's sponge.
- Parameters:
-
num_levels Recursive depth.
offset Location vector.
scale Relative size.
This function recursively draws a few levels of Sierpinski's Sponge in wireframe. If
num_levels is 0, draws 1 tetrahedron. The
offset is a translation. The
z axis is normal to the base. The sponge is centered at the origin.
- Note:
- Runtime is exponential in num_levels .
- See also:
- glutSolidSierpinskiSponge()
void glutWireSphere
(
GLdouble
radius,
GLint
slices,
GLint
stacks
)
Draw a wireframe sphere centered at the origin.
- Parameters:
-
radius Sphere radius.
slices The number of divisions around the z axis. (latitudal)
stacks The number of divisions along the z axis. (longitudal)
The
glutWireSphere() function draws a wireframe sphere centered at the origin. The "equatorial" great circle lies in the xy-plane.
- Note:
- The number of line segments representing the spherical surface is proportional to (slices*stacks).
- See also:
- glutSolidSphere().
void glutWireTeapot
(
GLdouble
size
)
Draw a wireframe teapot.
- Parameters:
-
size Scale factor.
This function draws the standard Teapot in wireframe using OpenGL evaluators. This is the classic "Utah Teapot" of computer graphics. The base should lie in the xy-plane with "up" being along the positive z axis.
This is derived from SGI code. It should also be the same as the teapot modeled by Martin Newell in 1975.
- See also:
- glutSolidTeapot()
void glutWireTetrahedron
(
void
)
Draw a wireframe tetrahedron.
This function draws a regular, wireframe 4-sided polyhedron centered at the origin. The distance from the origin to the vertices is 1.
- Todo:
- Merge r0 r1 r2 and r3 into one array.
Put the normals into the (or an) array.
Make the array static const, with file scope, and share with glutSolidTetrahedron().
Maybe consolidate with the SierpinskySponge?
- See also:
- glutSolidTetrahedron()
void glutWireTorus
(
GLdouble
dInnerRadius,
GLdouble
dOuterRadius,
GLint
nSides,
GLint
nRings
)
Draw a wireframe torus.
- Parameters:
-
dInnerRadius Radius of ``tube''
dOuterRadius Radius of ``path''
nSides Facets around ``tube''
nRings Joints along ``path''
This function effectively wraps a cylinder with
nSides slats and bends it at
nRings facets around a circular path, forming a torus, or ``donut''. The center is at the origin and the ``path'' rings around the z axis.
The torus parameters can be explored interactively with the OpenGLUT shapes demo.
- Note:
- dInnerRadius and dOuterRadius are not analogous to similar measurements of an anulus.
- See also:
- glutSolidTorus()
Generated on Sat Feb 5 01:47:29 2005 for OpenGLUT by
doxygen 1.3.9.1
The OpenGLUT project is hosted by
sourceforge.net.