The Chaos Game
The Chaos Game is a method of creating fractals using a polygon and a point that moves between the vertices of that polygon.
Sierpinski triangle Sierpinski carpet Sierpinski pentagon
The point starts at any position and continuously jumps towards a random vertex by a determined factor, drawing wherever it lands. To generate the Sierpinski triangle, the point jumps towards 1 of the 3 vertices at random by a factor of 1/2. The Sierpinski carpet requires additional vertices at the midpoints of the four edges and jumps between these vertices by a factor of 2/3. The Sierpinski pentagon is generated by jumping between the 5 vertices by a factor of 1/phi.
Controls
- Z - Pause/Resume
- X - Cycle through fractal shapes
- Left/Right - Change color mode
- Up/Down - Change speed
If you found this interesting you might also like my recreation of Conway's Game of Life.
Download
Development log
- Sierpiński Hexagon & bug fixJun 08, 2021
Leave a comment
Log in with itch.io to leave a comment.