The assignment itself is a gentle exercise in 2D data visualization. You'll be using the iterated quadratic transformation associated with the Mandelbrot set as a source of data for your images. The Mandelbrot set, M, is the set of complex numbers such that for any c, an element of M, the infinite series defined by iteration of the equation
To get started, click here
to run the install program, or (when that doesn't work)
make a copy of the directory
/cse/courses/cse457/projects/mandelbrot. (Note that you want to
copy the files to your account on the Indys, not on sanjuan, orcas, etc...)
After you've read over this assignment description, check
out the Project 0 help
session for introductory tutorials on making a home page,
OpenGL, libui, and CaseVision. Also, now may be a good time to
check out the sample solution.
calculateFractalto loop through the complex plane, storing the number of iterations it takes each point to diverge (you are given a function that determines this number for you). Use these numbers as indices into a color table to draw a color Mandelbrot set (a color table is defined for you).
zoomCallback. This should change the range of the computational plane, and then recalculate the set for this range.
Even though the Indys are very fast, there is still a considerable delay when zooming in while the mandelbrot is recalculated. Improve zooming by first zooming to a coarse, pixel-stretched version, and then sharpening to the recalculated set. For an extra , make zooming interactive: instead of using a zoom window, have the user drag the mouse to zoom in at a coarse resolution. Then, when the user lets go of the mouse, the Mandelbrot set visualization is recalculated.
A clever hack for playing with indexed color is to shift the entries in the color table and make the colors "animate." Implement color cycling as a "time out" procedure.
The starting point already comes with a nice color palette.
Add an option to use different palettes.
Zooming in is a fairly easy computation; zooming out is a bit harder. Allow a user to zoom out: zooming in once and zooming back out with the same rubber-band box should bring you to the exact same place.
Instead of calculating the visualization for the entire range, have a procedure to calculate one row at a time. If you make this an "Idle Procedure," a user can operate the controls while the Mandelbrot set is being calculated.
Allow a user to pan around the image. Your algorithm should be smart enough to copy redundant pixels and only calculate unknown information.
Add an option to allow a user to save the image as an
There is only one Mandelbrot set, but there is a Julia set associated with the same quadratic iterator for every point in the complex plane. Implement a feature so that when a user clicks on a point, the Julia set for that point is calculated.
Investigate more intelligent methods of looping through the complex plane. One possible solution is to employ a divide-and-conquer algorithm that fills in large, similar areas of picture. Another possible solution is to use contour tracing; i.e., trace around the edge of the Mandelbrot set first, and then trace around each surrounding ribbon.
Mathematically, you can infinitely zoom into a Mandelbrot set and still have an interesting picture. This breaks down, however, when using indexed color and a small number of iterations -- after a while no new detail is revealed. Implement a way to dynamically change the number of iterations, with either a user-controlled slider, or a more intelligent method. (Remember you'll need to update the color table as well!)
The calculation of the Mandelbrot set still takes too long. Speed up the calculation of the set by programming the inner most loops in optimized assembly language.
You can speed up the calculation of the Mandelbrot set even further by employing parallelism. Your challenge is to extend the program to employ all of the computers in the Indy lab to help calculate your Mandelbrot set in concert with each other.