The Menger Sponge Fractal, coded in P5JS
I made two different versions of the Menger Sponge, both of them are interactive.
The folder "MengerSponge" contains a version, where you can click the Menger Sponge with your mouse, to add additional iterations!
The folder "MengerSpongeCam" contains another version, using PEasyCam for P5JS.
This one is really cool: You can rotate the whole Fractal with your mouse, as well as zoom into it.
Time to explore infinity!
The Menger Sponge actually is a three-dimensional version of two other very, very famous Fractals:
Did you know: The Cantor Set is a One-Dimensional version of the Menger Sponge!
It looks loke this:
You can find out more about the Cantor Set here
If the Cantor Set is a one-dimensional Menger Sponge, what does a two-dimensional Menger Sponge look like?
Turns out there is another famous Fractal called the Sierpinski Carpet, and it looks like this:
If you want to learn more about the Sierpinski Carpet, check out this link