This program renders the perspective projection in two dimensional space of the perspective projection in three dimensional space of four-cube wireframes. The three dimensional camera can be moved and turned. The four-cubes can be rotated along any of the six coordinate planes in four dimensional space. Additionally, any of the eight four-cubes adjacent to the central four-cube can be rendered simultaneously.
Free rotation of a three dimensional object runs into a problem known as gimbal lock. The standard solution to the problem (for a variety of reasons) is to store the object orientation as a quarternion and apply rotations by multiplying in other quaternions. As an extension of that idea, this program implements four dimensional rotations using a four-dimensional Clifford algebra (of which quaternion algebra is a subalgebra). Internally, the program allows the multiplication of any two multivectors (elements of the Clifford algebra) of up to grade four. All possible products of blades are pre-calculated (with the Euclidean metric) using string matching methods, and are stored in multiplication tables. Products of multivectors are then calculated using the tables.
For very much more on Clifford Algebra see here.
The stereogram view is designed for wall-eyed viewing. The program window should be resized until it is small enough to view comfortably.
Written in C++ for Windows. Uses OpenGL and the GLSDK.
A few utility functions for initializing shaders were referenced from the Arcsynthesis OpenGL tutorial.