The Chaos Game is a mathematical method for generating fractals. It demonstrates how complex, deterministic structures can emerge from simple, random processes.
Rules of the Game
- Define a set of reference points (vertices) forming a shape.
- Start at any random position in the canvas.
- In each step, randomly select one of the vertices.
- Move a fraction of the distance (the Scale Factor) from your current position toward that vertex.
- Draw a dot at this new position, and repeat.
Constraints & Variations
By default, drawing towards 3 vertices produces the famous Sierpiński Triangle. For shapes with more vertices (like a square), standard rules just fill the shape completely. However, by adding simple constraints on which vertex can be chosen next, breathtaking structures emerge:
- No Opposite Vertex: In a square, the chosen vertex cannot be directly opposite the vertex chosen in the previous step. This creates a gorgeous nested square fractal pattern.
- No Adjacent Vertex: In a square, the chosen vertex cannot be clockwise adjacent to the previously chosen vertex. This generates an asymmetrical, spiraling fractal.
Interactive Controls
- Warping: Click and drag any of the large glowing vertex circles to warp the geometry. The fractal dynamically recalculates!
- Custom Mode: Select "Custom Shape" and double-click anywhere on the canvas to place your own vertices.
- Hotkeys: Spacebar to Pause/Play,
R to clear/reset.