Viewing the Fourth Dimension in your Browser


The incorporation of WebGL support in modern Web browsers has allowed building remarkable three-dimensional modeling and visualisation tools written in JavaScript that run directly within a Web browser—there’s no need to install any software on your computer, and performance is comparable to many special purpose 3D applications.

But what about the fourth dimension? Tarek Sherif has created an interactive Web page, Tesseract Explorer, which lets you view a tesseract (or four-dimensional hypercube, the four-dimensional analogue of the 3D cube, just as the cube is an analogue of the 2D square).

The four-dimensional object may be rotated around any of the four orthogonal axes in 4D space, conventionally called X, Y, Z, and W, projected into 3D space and then onto the 2D screen in either orthographic or perspective projection, and rendered as either transparent objects, cut-outs allowing you to see inside, or solid surfaces. Projection from 4D to 3D is done in JavaScript, and rendering of the resulting 3D object on the screen is handled by WebGL, allowing you to smoothly rotate the object by grabbing it and dragging with the mouse.

Complete source code, an explanation of the controls, and links to resources for building and understanding visualisations of 4D objects are available in the Tesseract Explorer repository on GitHub.