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.
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.
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:
2. Our program displays the following menu: "draw bezier curve".
3. User moves the mouse cursor over the words "Draw Bezier curve" a submenu appears with 8 possible colors:
4. User moves the mouse cursor over the word "purple" in the submenu:
5. User clicks the left mouse button of a multi-button mouse while the mouse is highlighting "purple" in the submenu:
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.
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.
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.
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.
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:
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.
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, 7.5 points. Additional points will be deducted for programs not meeting the specification as outlined above.
Fall 2015, CS-116A:
Lectures
Assignments: