Menger Sponge

2,952 views · Published 19 September 2011 · 0:41 · Indexed 11 October 2026

Channel: Paul Nathan · 2011 · Education

Watch on YouTube

The Menger Sponge fractal constructed with a cube seed up to level 4. The progression through the levels is also shown. This fractal was generated using the IFS (iterated function system) approach. In this approach, a base feature is recursively copied and transformed. In the present case there are 20 transformations per iteration involving only isotropic scaling and transformation (no rotation or shear). The 4D transformation matrices are given at the start of the video. This particular fractal has, in the limit of infinite recursion (fractals are limit objects), zero volume and infinite surface area.

The reason for only going to level 4 was that the next level had 20 times as many primitives which resulted in an out-of-memory exception! I would have to re-write the code to store the vertices in multiple arrays, although the required capacities get so large so quickly I think a hard disk scratch file would be the only way to achieve this....

More from this channel