SimpleAnimModern is sample C++ code illustrating the use of
Modern OpenGL. It is
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.
SimpleAnimModern shows how to draw and animate
triangles, triangle fans, and triangle strips.
It consists of three core source files, SimpleAnimModern.cpp,
ShaderMgrSAM.cpp, and ShaderMgrSAM.h;
plus five source files that provide functions to handle 3-dimensional
vectors and 4-dimensional vectors.
There are several options available for downloading this program:
- SimpleAnimModern.zip: A zip file, with the
three core source files and the
Windows 32-bit executable.
- SimpleAnimModernSource.zip: A zip file,
with the three core source files only.
- SimpleAnimModern.cpp,
ShaderMgrSAM.cpp,
ShaderMgrSAM.h:
Download the core source files, one at a time.
- The remaining source files LinearR3.[cpp,h],
LinearR4.[cpp,h] and MathMisc.h,
along with some documentation, are available at
the GlLinearMath web page.
Directly download via the
zip file R3R4Math.zip.
- Read the explanation
of some of the features of SimpleAnimModern and how it functions.
Things to try out:
- Compile and run the program.
Use the space bar to toggle between smooth shader and flat shading.
- Check out the new features of the SimpleAnimModern program (which are not already
present in SimpleDrawModern):
- Rendering using GL_TRIANGLE_FAN and GL_TRIANGLE_STRIP.
- Using projection and model view matrices to position geometric objects.
- Using a model view matrix to create an animated (slowly rotating) geometric object.
- Using multisampling antialiasing (MSAA).
- Using two shader programs; one that does smooth shading and one that does flat shading.
- Using uniform shader variables for the modelview and projection matrices.
- Using the LinearR3 and LinearR4 classes, defined in LinearR3.h, LinearR3.cpp, LinearR4.h,
and LinearR4.cpp.
- Try disabling the MSAA multisampling, and observe the difference in
the appearance of the rotating triangles.
- See the more detailed description of
the software and its functionality.
Version 1.3 of SimpleAnimModern, August 21, 2019.