Processing - Menger Sponge
Overview
This is a Processing sketch inspired by the Coding Train’s Coding Challenge #2 on create a Menger Sponge.
Keys:
w
ands
move in and out respectivelyUP
/DOWN
tilts the object forward and backLEFT
/RIGHT
rotates the object around a vertical accessc
resets the iteration to the first stepr
toggles the rotation on / off.
Mouse:
- Click (anywhere) … generates the next step in the recursion (up to a limit, to avoid generating too many boxes)