SolarModern 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.
SolarModern shows a simple solar system containing sun,
the earth and a moon.
It consists of three core source files, SolarModern.cpp,
ShaderMgrSLR.cpp, and ShaderMgrSLR.h;
plus five source files that provide functions to handle 3-dimensional
vectors and 4-dimensional vectors, and 4 source files for rendering
spheres.
There are several options available for downloading this program:
- SolarModern.zip: A zip file, with the
three core source files and the
Windows 32-bit executable.
- SolarModernSource.zip: A zip file,
with the three core source files only.
- SolarModern.cpp,
ShaderMgrSLR.cpp,
ShaderMgrSLR.h:
Download the core source files, one at a time.
- Also needed are the five source files LinearR3.[cpp,h],
LinearR4.[cpp,h] and MathMisc.h.
These along with some documentation, are available at
the GlLinearMath web page.
Directly download via the
zip file R3R4Math.zip.
-
In addition, the four source files GlGeomSphere.[cpp,h]
and GlGeomBase.[cpp,h]
are needed. These render spheres for the planets. They can be downloaded
from the page GlGeomShapes web page.
- Read the explanation
of some of the features of SolarModern and how it functions.
Things to try out:
- Compile and run the program.
- Check out the new features of the SolarModern program (which are not already
present in SimpleDrawModern
or SimpleAnimModern):
-
Animation with fixed time step.
-
Animation rate based on elapsed time using glfwGetTime().
-
Using the projection matrix to view a scene with perspective.
-
See time aliasing effects, especially from the rotation of the earth.
-
Using the GlGeomSphere class, defined in GlGeomSphere.h and GlGeomSphere.cpp.
- Understand what causes the time aliasing in fixed time step mode
- Understand why there is also aliasing with large time steps.
- See the more detailed description of
the software and its functionality.
Version 1.4 of SolarModern, October 5, 2022.