Menger Sponge
This interactive visualization renders a level 3 Menger Sponge fractal, a 3D shape formed by recursively removing the center cube from each face and the central cube of the remaining structure. The sponge is built with Three.js, using recursive grouping and `BoxGeometry` meshes with `MeshPhongMaterial` shading. The scene includes multiple lighting sources—ambient, directional, hemisphere, and point lights—to highlight the fractal’s deepening cavities. The model slowly rotates via an animation loop, while `OrbitControls` allow the user to rotate, pan, and zoom the view.
AI-generated descriptionMenger Sponge Visualization
A 3D visualization of a Menger Sponge fractal using Three.js.
Controls
- Left click and drag to rotate the view
- Right click and drag to pan
- Scroll to zoom in/out
The visualization shows a level 3 Menger Sponge, which is a 3D fractal created by recursively removing the center cube from each face and the very center cube of a larger cube.
Changes
- Increased fractal iteration level from 2 to 3
- Adjusted camera settings for better viewing of deeper fractal structure
- Improved material properties for better visual clarity