The previous few pages render the Mandelbrot set in two dimensions by painting it onto a rectangular pane. The present program renders in three dimensions. A window on the complex plane is overlaid with a regular grid each of whose grid points corresponds to a complex number . The grid is lifted into space by translating each grid point to a height equal to ‘s escape time.1 As in the previous pages, escape time is used to determine color. But on the 3D landscape, it is also used to determine height.
In the following program, the 3D landscape is built on the back side of the rectangular pane. The pane’s front side presents the flat Mandelbrot set with navigation control for zooming and panning. When the user presses Go, the Mandelbrot set gets recomputed for the 3D landscape, whereas it gets recomputed (as before) for the front navigation side on every rendering refresh.
- Recall that escape time of is the smallest such that where and . We’ll say that the escape time of is equal to one greater than the maximum number of iterations (levels). ↩