Programming Project 2
DATE DUE: November 2, 2015
Points possible: 15 points
CS-116A: Introduction to Computer Graphics
Instructor: Rob Bruce

OVERVIEW

For this project, you will be using GLUT along with a point device (mouse) to create a program that allows users to draw Bezier curves. Users should be able to draw up to 20 separate Bezier curves. You are not required to provide editing capability for previously drawn curves.

SPECIFICATIONS

1. Bezier curves should be drawn through a series of four mouse clicks with the right mouse button.

2. You are NOT required to draw a crosshair or other visual indicator when the user clicks the right mouse button for the four Bezier curve control points.

3. Bezier curves should NOT include a filled/outline submenu. Bezier curves are never filled and must be drawn one pixel width.

4. You must prompt the user for the choice of color to use when drawing a Bezier curve.

5. Use the left mouse button to select from a palette of 8 colors to draw the Bezier curve.

EXAMPLE

Here's an example of a mouse-driven menu that conforms to the above specification.

1. User clicks the left mouse button of a multi-button mouse:

Two button computer input device (mouse) with left button highlighted to indicate it is being pressed.

2. Our program displays the following menu: "draw bezier curve".

Screen capture of menu that appears when left mouse button is clicked. The menu is labeled "Draw Bezier curve."

3. User moves the mouse cursor over the words "Draw Bezier curve" a submenu appears with 8 possible colors:

Screen capture of menu that appears when left mouse button is clicked. A menu appears with the text "Draw Bezier curve" followed by a sub-menu with eight possible color choices: "red", "green", "blue", "purple", "yellow", "orange", "black", "white."

4. User moves the mouse cursor over the word "purple" in the submenu:

Screen capture of menu that appears when left mouse button is clicked. A menu labeled, "Draw Bezier curve" appears followed by a sub-menu containing colors: "red", "green", "blue", "purple", "yellow", "orange", "black", and "white."  The color purple is selected.

5. User clicks the left mouse button of a multi-button mouse while the mouse is highlighting "purple" in the submenu:

Two button computer input device (mouse) with left button highlighted to indicate it is being pressed.

6. Upon clicking the left mouse button in step 5, the user has indicated they want to draw a purple colored 1 pixel Bezier curve. Now we must retrieve four control points from the user: the beginning point where the Bezier curve will start, the second control point, the third control point, and the fourth control point where the curve will end. The first and last control points will be on the curve while the second and third points will not be on the curve. The user moves the mouse somewhere on the screen and clicks the right mouse button of a multi-button mouse. This represents the first point of the Bezier curve.

Two button computer input device (mouse) with right button highlighted to indicate it is being pressed.

7. User moves the mouse somewhere on the screen and clicks the right mouse button again. This represents the second point of the Bezier curve.

Two button computer input device (mouse) with right button highlighted to indicate it is being pressed.

8. User moves the mouse somewhere on the screen and clicks the right mouse button again. This represents the third control point of the Bezier curve.

Two button computer input device (mouse) with right button highlighted to indicate it is being pressed.

9. User moves the mouse somewhere on the screen and clicks the right mouse button one last time. This represents the fourth control point of the Bezier curve.

Two button computer input device (mouse) with right button highlighted to indicate it is being pressed.

10. Immediately after the user clicks the right mouse button a fourth time in step 9 above, a 1-pixel width Bezier curve is drawn in purple:

One pixel width Bezier curve drawn in purple on a white background

PLEASE INCLUDE THE FOLLOWING WITH YOUR PROGRAM

1. Please submit your program as a text file labeled "Programming Project 2" 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 following naming convention:

Lastname_Firstname_programming_project_2.c (for C programs)

Lastname_Firstname_programming_project_2.cpp (for C++ programs)

Lastname_Firstname_programming_project_2.java (for Java programs)

For example, my name is Rob Bruce. If I write my program in the C programming language, my programming project 2 should be named: Bruce_Rob_programming_project_2.c

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, regardless of language; 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 build without syntax errors.

6. I expect your program to execute without run-time errors.

GRADING

Points will be deducted for any program that does not meet the specification as outlined above.

LATE ASSIGNMENTS

Assignments submitted after the due date will be worth, at most, 7.5 points. Additional points will be deducted for programs not meeting the specification as outlined above.

Robert Bruce

Contact and Office hours

Education

Research interests


Research

Publications

Graduate supervision

Undergraduate supervision


Courses

Fall 2015, CS-116A:

Greensheet

Lectures

  • Light and Color (part 1 of 2)
  • Light and Color (part 2 of 2)
  • Introduction to OpenGL and GLUT
  • Dissection of OpenGL/GLUT programming examples in C
  • Dissection of OpenGL/GLUT programming examples in Java
  • Splines
  • Meshes: Vertices, Edges, and Faces
  • Camera and clipping plane
  • Linear transformations
  • Interactive program to adjust frustum, near, and far clipping planes
  • Metaballs and Blobbies
  • Graphics File Formats
  • Accelerated Graphics Hardware (GPU)
  • GLSL: OpenGL Shading Language (part 1 of 2)
  • GLSL: OpenGL Shading Language (part 2 of 2)
  • Squash, Stretch, and Bounce: The twelve principles of animation
  • Introduction to Blender
  • Character Rigging for animation
  • Algorithmic animation and modelling (part 1 of 2)
  • Algorithmic animation and modelling (part 2 of 2)
  • Introduction to Computer Vision
  • Introduction to WebGL

Assignments:


Other

Valid XHTML 1.0 Strict Valid CSS!