

While moving the 3D camera acts as you’d expect, moving and turning the 4D camera can appear to twist and deform the object without necessarily moving it. Getting all of these steps correct is difficult as they cannot be worked on independently and tested easily - it is the sum of these steps that achieve even the simplest result. Next, a projection matrix is used to project vertices into the third dimension, where it is then perceived by a separate, 3D camera and then finally projected to 2D for rendering on screen. A 4D camera can be used to view the fourth dimension from various positions and angles and is just as useful and important as a 3D camera in any 3D game. For this project, I want to perform projections and other transformations using GPU shaders like you would for an ordinary game. The tesseract is a 4D hypercube and is suitable as the main polytope for this project. In order to see a 4D object, a 4D object needs to be created.

Changing the settings of the 4D camera will also change the appearance of the object - as an exercise to the reader, I highly recommend translating the shape and then moving the 4D camera to correct it! How does it work? Perceiving the 4th dimension Pick a polytope from the menubar in the top left and then use the transformation window to manipulate it. Hold down the right-mouse-button and move the mouse to look around the simulation (much like an FPS game). Use WASD to move the camera with space and c to go upwards and downwards.
#4D SIMULATOR ONLINE CODE#
This was really interesting to make as GLSL did not support 5x5 matrices used to manipulate the 4th dimension, and so I had to essentially write matrix mathematics in the shader code in order to get this to work! How do I use it?
#4D SIMULATOR ONLINE FULL#
See report.pdf for a full writeup about what this project is and how it was made. This project is an interactive simulation for visualising 4D geometry. GitHub repository for the viewer can be found here.
