GlGeomShapes is a collection
of C++ programs generating triangular meshes for some
simple geometric objects. It presently supports:
- Spheres,
- Cylinders,
- Cones,
- Tori,
- Cubes,
- Bezier patches, and
- Utah Teapot.
GlGeomShapes also includes code for
rendering them in Modern OpenGL, allowing them to be easily
included in other programs. These are
part of
a set of programs introducing the
use of Modern OpenGL, which are
intended to accompany a possible second edition
of the book
3D Computer Graphics: A mathematical
approach with OpenGL, Cambridge University Press, 2003.
GlGeomShapes currently supports spheres,
cylinders, cones, tori, cubes, Bezier patches, and the Utah teapot.
The entire code package can be downloaded
in a zip file from
the URL below.
All shapes need to use the two base files GlGeomBase[.cpp,.h].
Spheres need to use GlGeomSphere[.cpp,.h].
Cylinders need to use GlGeomCylinder[.cpp,.h].
Cones need to use GlGeomCone[.cpp,.h].
Tori need to use GlGeomTorus[.cpp,.h].
Cubes need to use GlGeomCube[.cpp,.h].
Bezier patches need to use GlGeomBezier[.cpp,.h].
Utah teapots are built from Bezier patches and
need to use the four files
GlGeomBezier[.cpp,.h] and GlGeomTeapot[.cpp,.h].
- GlGeomShapes.zip: A zip file, with
all of the source files.
- Read the documentation on how
to use these in your C++ code.
- For sample code using GlGeomShapes, see the
SolarModern online explanation (for spheres only) or
the GlGeomShapesTester source code
(for all shapes).
- GlGeomShapes supports rendering just portions of objects, such as
single slice or stack of a sphere, the side or a single face of a cone
or cylinder, a single slice or ring of a torus,
or one of the parts of the teapot,
etc. For this, see the documentation, or the sample code in GlGeomShapesTester.
The code
uses GLEW (Opengl Extension Wrangler) for the interface to OpenGL.
Thanks to Derrick Yao for contributing GlGeomCube to the package.
Version 1.3/1.4 of GlGeomShapes, last revision July 24, 2023. Copyright 2020, 2022, 2023.