Four is an interactive real-time renderer for 4D objects. The rendering pipeline generalizes the standard computer graphics pipeline for 3D objects. The camera sits inside of 4D space. Objects are projected to a 3D hyperplane and rasterized to produce a volumetric image, which then gets passed to the standard 3D→2D rendering pipeline.
Four is still in a rudimentary state. Currently, basic rendering for hypersurfaces and codimension-2 surfaces has been implemented. This widget allows the user to select from a preset list of regular convex polytopes—the 5 cell/simplex, the 8-cell/hypercube, and the 16-cell/orthoplex—as well as a few codimension-2 surfaces—an embedded \(\mathbb{RP}^2\) and a more complicated genus 1 surface. Four is coded using a combination of Javascript and WebGL. Mathematical and design direction are by me. Most of the code is written by Claude.
There are currently three control schemes for the camera. All three use a pair of quaternions controlled by a pair of trackballs to rotate the camera, but each works in a different way.
The keyboard can be used to fly the camera through 4D space in any mode. The buttons at the bottom of the control panel reset the camera position and recenter its view.