ECE660 Interactive Computer Graphics Spring, 2003
Project #1 Mandelbrot Mania
Due on-campus: Monday March 10, 2003; off-campus: ~2 weeks after receipt.
Design, implement, and exercise the applications below. User controls
may be implemented either with key strokes, or with GLUI controls, at your
discretion. Some controls will require the mouse.
Write an application that draws a portion of the Mandelbrot set in "pixel
blocks" (described in class). Initially the entire Mandelbrot set is shown
as an array of colored squares (a raster), using the default window (with
opposite corners: -1.5 + j1.2 and 0.5 - j1.2). The raster consists of numAcross
columns and as many rows as will fit in the screen window. The user
then designates a rectangle (using a rubber rectangle), and the designated
portion of the Mandelbrot set is redrawn in the biggest viewport that fits
in the screen window. Whenever the screen window is reshaped by the user,
the current Mandelbrot piece is drawn again as large as possible. For all
drawings, there must be no aspect ratio distortion.
Choose colors for pixels that produce exquisite pictures, as discussed
in class. For instance, points inside the Mandelbrot set are black, those
just outside are a brilliant yellow, and for points further outside the
color changes gracefully towards a blue or green.
Interactions: Allow the user to control certain actions and values:
-
numAcross: the user can set a new value (the default is 100);
-
Reset the window for the Mandelbrot set to its default.
-
numIterations: the user can set a new value for the number of
iterations in the dwell() calculation (the default is 100);
-
Quit the program
Important: Because drawing the Mandelbrot set can be a lengthy process,
arrange matters so that if the user presses the escape key (ASCII 27) while
the drawing of the Mandelbrot set is in progress, the drawing is interrupted
at the end of drawing the current row. [One way to do this; drawing is
done in the "idle callback function", and at each invocation the "next"
undrawn row of the Mandelbrot picture is drawn.]
Extra Credit (15 points) - "The Grabber"
(If you are working in a group, this is a required part of the project.)
Add a screen capture facility to your programs. Upon pressing 'C'
the user can designate a window on the screen with the mouse (use rubber
rectangle) and press RETURN, and the pixmap representing that portion of
the screen is written into a BMP file. The routine RGBPixmap:: writeBMPFile()
is provided (see the FTP site) to help with this. Submit several example
BMP files taken from your project.