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:

Things to try out:

  1. Compile and run the program. Use the space bar to toggle between smooth shader and flat shading.
  2. 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.
  3. Try disabling the MSAA multisampling, and observe the difference in the appearance of the rotating triangles.
  4. See the more detailed description of the software and its functionality.

Version 1.3 of SimpleAnimModern, August 21, 2019.