This simulation renders self-similar Sierpiński fractals in interactive 3D using WebGL and Three.js. The Chaos Game mode plots up to 400,000 points: starting inside a regular tetrahedron, each step jumps halfway toward a randomly chosen corner, and the scattered dust converges onto the attractor. The result is the spatial analogue of the classic triangle, governed by an iterated function system of four contraction maps, each scaling by one half.
You can switch between three modes — Chaos Game (a point cloud), Sierpiński Tetrahedron (recursively subdivided instanced tetrahedra), and a 3D Carpet built on the Menger-sponge rule. Sliders set the point count or recursion level (1–5), while colour schemes shade by vertex, height or monochrome. Drag to orbit, scroll to zoom, and toggle auto-rotate. Such fractals model natural roughness in antennas, lung branching and porous materials.
What is the Sierpiński triangle?
It is a self-similar fractal in which the whole figure is made of three smaller copies of itself, each half the size. Removing the central triangle at every scale leaves an infinitely detailed gasket. This page extends the idea into three dimensions with a Sierpiński tetrahedron and a Menger-style carpet.
How does the Chaos Game produce a fractal from random jumps?
Start at any point inside the shape, pick one of the four tetrahedron corners at random, and move halfway toward it, plotting the new position. Repeating this thousands of times can never place a point in the removed regions, so the random scatter settles exactly onto the fractal attractor.
What is the fractal dimension shown in the statistics?
The panel reports the Hausdorff dimension. For the 3D Sierpiński structures here the simulation shows 2.0 (log 4 / log 2), and for the Menger-style carpet it shows roughly 2.7268 (log 20 / log 3). These non-integer values place the objects between ordinary surfaces and solid volumes.
In Chaos Game mode the Points slider sets how many random points are plotted, from 20,000 up to 400,000 — more points give a sharper, denser cloud. In the Tetrahedron and Carpet modes the Recursion level slider (1 to 5) controls how many times the shape is subdivided, exponentially increasing the number of sub-cells drawn.
Fractal dimension follows D = log(N) / log(s), where N is the number of self-similar copies and s is the scaling factor. The flat triangle gives log 3 / log 2 ≈ 1.585. The Sierpiński tetrahedron uses four copies scaled by two, giving log 4 / log 2 = 2, and the carpet uses log 20 / log 3 ≈ 2.727.
The Sierpiński tetrahedron is built from four copies, each scaled by a factor of one half, so its dimension is log 4 / log 2 = 2. Remarkably this equals the dimension of a flat plane, even though the object is hollow and lives in 3D space, which is why its surfaces appear to fill area despite the gaps.
The construction rules are exact: the Chaos Game uses true halfway interpolation toward randomly selected vertices, and the recursive modes subdivide using the correct self-similar maps. The displayed dimensions match the theoretical values. Only the resolution is finite, since real fractals continue to infinite depth while the screen and point budget are limited.
Chaos Game renders a stochastic point cloud that approximates the attractor. The Tetrahedron mode draws solid instanced tetrahedra placed by deterministic recursion. The 3D Carpet applies the Menger-sponge rule to a cube grid, removing the central cells at each subdivision to leave a porous lattice of small cubes.
By vertex tints each element using the colour of the corner it relates to, highlighting the four sub-structures. By height maps the vertical position through a hue gradient so the shape reads like a heat map. Monochrome paints everything a single blue, emphasising form over colour.
Self-similar structures appear in branching lungs and blood vessels, river networks, snowflakes and coastlines. Engineers use Sierpiński patterns to design compact, multi-band fractal antennas, while Menger-style geometries inform porous materials, heat exchangers and metamaterials where high surface area within a small volume is valuable.
Two methods to create the Sierpinski triangle: the Chaos Game (randomly jumping half-way to a chosen vertex) and recursive subdivision (removing the central triangle at each level). Hausdorff dimension ≈ 1.585.
The Chaos Game plots thousands of random points. Each point jumps halfway to a randomly chosen vertex. Miraculously, this random process produces a perfect fractal — order from randomness.
Switch between Chaos Game and recursive modes. Adjust iteration count and colour scheme. Pan and zoom to explore self-similarity.
Wacław Sierpiński described this triangle in 1915. Its Hausdorff dimension of log(3)/log(2) ≈ 1.585 means it's "more than a line but less than a plane" — a fraction of a dimension.