AI Generated finetuned for the visualisation and not code quality.
600cell.mov
Interactive C + Raylib viewer for the 600-cell, a regular 4D polytope. The app generates the polytope's 4D vertices, connects nearest-neighbour edges, rotates the shape through multiple 4D planes, projects it down into 3D and then 2D, and lets you explore a highlighted W-slice of the structure in real time.
- Generates the 120 canonical 4D vertices of the 600-cell
- Builds edge connectivity by detecting the shortest 4D neighbour distance
- Animates simultaneous rotations in the
XY,XZ,XW,YZ,YW, andZWplanes - Projects the rotating 4D shape into 3D and then onto the 2D window
- Colors points and edges by their current
Wcoordinate - Highlights a configurable
Wslice so you can see which parts of the polytope sit near a chosen hyperplane - Lets you orbit the projected view in 3D and manually drag the
XWandYWrotations - Shows hover details for vertices and edges, including degree, current 4D coordinates, and projected edge length
| Area | What You See |
|---|---|
| Geometry | A rotating projection of the 4D 600-cell |
| Color | Hue shifts with the current W coordinate |
| Brightness | Points and edges brighten when they are near the active W slice |
| Left Drag | Orbit the 3D projection |
| Right Drag | Push the shape through XW and YW rotations |
| Mouse Wheel | Zoom the projection |
| Side Panel | Live sliders for projection, styling, rotation speeds, and slicing |
flowchart LR
A["4D Vertex Families<br/>8 axis points<br/>16 sign points<br/>96 golden-ratio points"]
B["Nearest-Neighbour Edge Build<br/>connect shortest 4D pairs"]
C["Animated 4D Rotation<br/>XY XZ XW YZ YW ZW"]
D["4D -> 3D Projection<br/>controlled by wDist"]
E["3D Orbit View<br/>yaw + pitch from left-drag"]
F["3D -> 2D Projection<br/>controlled by zDist"]
G["Screen Render<br/>edges, points, hover inspector"]
A --> B --> C --> D --> E --> F --> G
classDef geo fill:#16324f,stroke:#8fd3ff,color:#f4fbff,stroke-width:2px;
classDef motion fill:#3c1642,stroke:#f08bd7,color:#fff4fb,stroke-width:2px;
classDef proj fill:#234f1e,stroke:#9be27f,color:#f6fff4,stroke-width:2px;
classDef render fill:#5b3a00,stroke:#ffd166,color:#fff9ec,stroke-width:2px;
class A,B geo;
class C motion;
class D,E,F proj;
class G render;
flowchart TB
W["Chosen W Slice<br/>sliceW +/- sliceThickness"]
P["Points near the slice<br/>larger radius + brighter glow"]
E["Edges near the slice<br/>extra width + alpha boost"]
C["Hue by W value<br/>blue/cyan through warmer tones over time"]
H["Hover inspector<br/>vertex degree, 4D coords, edge metrics"]
W --> P
W --> E
C --> P
C --> E
P --> H
E --> H
classDef slice fill:#1d3557,stroke:#8ecae6,color:#f1f8ff,stroke-width:2px;
classDef focus fill:#5a189a,stroke:#f72585,color:#fff5ff,stroke-width:2px;
classDef info fill:#264653,stroke:#e9c46a,color:#fffbea,stroke-width:2px;
class W slice;
class P,E,C focus;
class H info;
- Point color: encodes the current
Wcoordinate - Point size: grows when a vertex is close to the active
Wslice - Edge brightness: increases when an edge sits near the slice or is hovered
- Hover focus: unrelated geometry is dimmed so local structure is easier to read
- Bottom info card: switches between vertex-specific and edge-specific measurements
q: quit1: open the main 600-cell viewer2: open page 2 placeholderspace: pause or resume animation
mouse wheel: zoom in or outleft drag: orbit the 3D projectionright drag: manually adjustXWandYW4D rotationhover vertex: inspect degree,W, slice delta, and current 4D coordinateshover edge: inspect endpoint ids, 4D edge length, projected length, and meanW
- View and styling:
Zoom,Line Width,Point Size,Edge Alpha - Projection:
W Distance,Z Distance - Rotation rates:
rXY,rXZ,rXW,rYZ,rYW,rZW - Slice controls:
Slice W,Slice Width,Slice Boost
The most useful mental model is that the app is not only drawing a spinning wireframe. It is also giving you a moving spotlight through the fourth dimension:
sliceWpicks a target location along theWaxissliceThicknessdefines how much nearby geometry counts as "in slice"sliceBoostmakes that neighbourhood stand out visually
This makes it easier to see how a 4D object changes as different parts of it pass near a chosen hyperplane.
raylibpkg-config- a C compiler such as
ccorclang
make
make run