Projects, portfolio, and personal work of Joe Pelz

Kaleidoscope

Mirrors, mirrors, on the walls. Where am I in these mirrored halls?

Move the corners of the triangle to make your own kaleidoscope!

Or upload one:

Download the image

You can get some especially interesting shapes if you make a really thin triangle.

The code works by taking the canvas and folding the outside-the-triangle part along each of the triangle edges (in order, repeatedly) until the entire canvas is inside the triangle. Then it prints the triangle image and displays the unfolded image.

See the live source code here, especially the generateKaleidoscope() function.