Programming assignment 4: A 2D paint and draw program
CS-116A: Introduction to Computer Graphics
Instructor: Robert Bruce

Objective

For this assignment, you will be creating a simple paint and draw program in C or C++ with the OpenGL Utility Toolkit (GLUT). The specifications are outlined below.

Specifications

The program must draw the following shapes:

  • Line
  • Rectangle
  • Ellipse
  • Bezier curve

Your program must draw rectangles and ellipses in filled or outline (unfilled) form. Bezier curves and lines should NOT be drawn in filled or outline form. Please do NOT include menu options to draw Bezier curves or lines as filled/outline.

Users should be able to select from a palette of 8 different colors when drawing a line, rectangle, ellipse, or Bezier curve. You may choose any colors for your palette as long as each color is visible on the paint canvas (the background of your screen). Please do NOT use black as a color choice on a black background canvas or white on a white background canvas.

Use the left mouse button for navigation and selection in the paint program drawing menu.

Use the right mouse button to select a control point (mouse cursor position) when drawing a line, rectangle, ellipse, or Bezier curve.

Bezier curves are drawn through a series of four mouse clicks. Bezier curves should be 1 pixel thick.

Lines are drawn through a series of two mouse clicks. Lines should be 1 pixel thick.

Please use white or black as the background for your drawing canvas.

You may use verbs such as "add" or "draw" in your menu items. For example, you may use "add rectangle" when drawing a shape. Alternately, you may use "draw rectangle" as a menu item instead

Your program must allow the user to draw at least twenty shapes (any combination of ellipses, rectangles, lines, or Bezier curves).