🧱 Tesseract — 4D Hypercube

A tesseract is the four-dimensional analogue of a cube: 16 vertices at every combination of (±1,±1,±1,±1) joined by 32 edges. Rotate it independently in the xw, yw and zw planes and watch a perspective projection reveal its true four-dimensional structure.

About this simulation

Written by MySimulator Team · Reviewed by MySimulator Editorial Review

Last updated: 11 July 2026

This tool renders a tesseract, the four-dimensional analogue of a cube, and lets you rotate it independently in three planes that involve a fourth spatial axis, w. Because a genuine 4D object cannot exist inside a 3D screen, each frame projects the rotated vertices down into ordinary space using a perspective transform driven by the w coordinate — the same idea a normal 3D-to-2D projection uses, just one dimension higher.

🔬 What it shows

The tesseract's 16 vertices sit at every combination of (±1,±1,±1,±1), joined by 32 edges linking vertices that differ in exactly one coordinate. Each frame applies 4D rotations in the xw, yw and zw planes, then projects every point into 3D with scale = d/(d−w), where d is the projection distance. The result is a wireframe hypercube whose apparent shape continuously warps as its fourth-dimensional orientation changes.

🎮 How to use

Adjust the XW, YW and ZW sliders to change how fast the shape rotates through each 4D plane, and the projection distance slider to control the strength of the perspective effect. Toggle vertex spheres on or off, pause the 4D rotation while still orbiting the camera with your mouse, reset everything to defaults, or turn on autorotate for a hands-free view.

💡 Did you know?

A tesseract has 16 vertices, 32 edges, 24 faces and 8 cubic cells. Rotating it in a plane that includes the w axis makes the shape appear to turn itself inside out — a motion that is completely natural in four dimensions but looks paradoxical when projected into three.

Frequently asked questions

What is a tesseract?

A tesseract, also called an 8-cell or hypercube, is the four-dimensional analogue of a cube. A cube is bounded by 6 square faces; a tesseract is bounded by 8 cubical cells. It has 16 vertices and 32 edges, generated by taking every combination of ±1 across four coordinates instead of three.

How can a 4D object be shown on a 2D or 3D screen?

It can't be shown directly, only projected. Just as a 3D cube casts a 2D shadow, a 4D tesseract casts a 3D shadow. This simulation rotates the tesseract's vertices in 4D, then applies a perspective projection based on the fourth coordinate (w) to bring every point into ordinary 3D space, which is then rendered normally with Three.js.

What do the xw, yw and zw rotation planes mean?

In 4D there are six independent coordinate planes you can rotate through: xy, xz, yz, xw, yw and zw. The first three behave like ordinary 3D rotations and don't reveal the fourth dimension. The xw, yw and zw rotations each mix an ordinary axis with the new w axis, which is what makes the hypercube's faces appear to swap, stretch and fold as they move through 4D space.

Why do the edges seem to change length as the shape rotates?

Every edge of the tesseract has the same length in true 4D space. What you see changing is the perspective projection: points with a larger w coordinate get scaled down more strongly (scale = d/(d−w)), so as vertices rotate toward or away from you along the w axis, their projected 3D positions appear to move closer together or spread further apart, even though nothing in 4D actually changed length.

Is this the same as just rotating a cube in 3D?

No. A cube rotating in ordinary 3D space always looks like a cube from every angle. A tesseract rotated through a w-involving plane and projected into 3D can appear to have vertices passing through faces, cells nesting inside one another, or the whole shape seeming to turn inside out — behaviour that has no equivalent for a solid confined to three dimensions.