For this project, you will modify the color output used in a Mandelbrot fractal generator written in C++ and the OpenGL Utility Toolkit (GLUT). There are two goals for this project:
The specifications are outlined below.
Please use the example program for drawing Mandelbrot fractals in our textbook, Computer Graphics with OpenGL on pages 714-715. You may also download the source code (chapter 23) from the author's website at http://wps.prenhall.com/ecs_hearn_cg_o_gl_4/
The original source code displays a Mandelbrot fractal using the following colors:
Modify the source code such that the Mandelbrot fractal is drawn with a completely new set of colors. DO NOT USE ANY OF THE COLORS DEFINED ABOVE.
This is an opportunity for you to identify and modify the existing code to see how to specify color in GLUT. Remember: A color is defined by three components: a Red, a Green, and a Blue (RGB) value. For this assignment, you want to enter RGB values as decimal numbers between 0 and 1 inclusive.
For example, to define a color as purple (a mixture of red and blue), we'd use the following for the Red, Green, and Blue values:
I have created a makefile to build the project as well. You may download the makefile for my code at http://www.cs.sjsu.edu/~bruce/programs/fall_2016_cs_116a/drawing_mandelbrot_fractals/Makefile. Save the downloaded file as Makefile (not Makefile.txt)
To build my sample code, copy to a local directory on your computer. In the directory where the source code and makefile are located, type the following command in a shell or terminal window:
make
Example output when I invoke the makefile
rob@laptop ~/progs/FALL_2016/cs_116a/project_1 $ make
g++ -o bruce_rob_project_1 bruce_rob_project_1.cpp -lglut -lGL -lGLU -lX11 -lXmu -lXi -lm
To run the compiled program I merely enter bruce_rob_project_1 (the name of the compiled program) on the command line like this:
rob@laptop ~/progs/FALL_2016/cs_116a/project_1 $ bruce_rob_project_1
Note: obviously you will need to edit the Makefile to use the appropriate C++ input file.
1. Please submit your program to the Canvas dropbox. I only need the source code. I will build the program myself.
2. Please name your programming project file with the zfollowing naming convention:
Lastname_Firstname_programming_project_1.c (for C programs)
Lastname_Firstname_programming_project_1.cpp (for C++ programs)
3. Please include your name as a comment at the beginning of your program like this:
/* Rob Bruce */
or this:
// Rob Bruce
4. I usually do not need a makefile to build your programs; however, in the unlikely event that I cannot build your project, I will send an email inquiry as appropriate.
5. I expect your program to compile without syntax errors.
6. I expect your program to execute without run-time errors.
Points will be deducted for any program that does not meet the specification as outlined above.
Assignments submitted after the due date will be worth, at most, 5 points. Additional points will be deducted for programs not meeting the specification as outlined above.
Fall 2016, CS-116A:
Lectures
Assignments:
Handouts:
Programs: