Programming assignment 1: Drawing Mandelbrot fractals
CS-116A: Introduction to Computer Graphics
Instructor: Robert Bruce

Objective

For this assignment, 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 assignment:

  • To become familiar with OpenGL and the GLUT library.
  • To become familiar with make to build (compile) your C/C++ programs on a GNU/Linux operating system.

Specifications

Please use the example program for drawing Mandelbrot fractals in our textbook, Computer Graphics with OpenGL on pages 714-715.

The original source code displays a Mandelbrot fractal using the following colors:

  • Black
  • Orange
  • Red
  • Dark Blue
  • Yellow
  • Dark Green
  • Cyan

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: Red, Green, and Blue (RGB). 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:

  • RED: 1.0
  • GREEN: 0.0
  • BLUE: 1.0