![]() |
| Home | People | Curriculum | Projects | Resources | Media |
Computer Graphics |
CMSC 212 |
|
Haverford College |
Fall 2003 |
|
Lab 2 |
Wednesday, September 31 |
Mouse & Keyboard Interaction, and 3D Transformations, with OpenGL
This project extends work from the previous lab assignment, and should not be started until the previous one is completed successfully. In fact, many of the labs build on each other, so proper programming organization and documentation are essential throughout the course. You may want to return to the previous lab and reorganize it so it is simpler to extend.
Design and implement a C++ program using OpenGL calls to permit the user to point to a position in the drawing window and click to draw a shape using the same scheme as before:
Your program should also maintain a list of the shapes drawn in the current "universe." Each entry in the list needs to contain enough information to redraw its corresponding shape at the "proper position and size."
The program should again accept mouse input keyboard input and the mouse input concurrently. Some of the keystrokes have been reassigned in this lab for 3D transformations. The following keyboard characters should be used, with the associated actions:
exit(0))Please include text instructions for drawing and transformations in the standard text window (i.e., use cout ...)
Obtaining and submitting labs have also been revised. The lab is completed as follows:
main.cpp file from the previous lab to save it as lab1.cpp, then copy again into login.2.cc, where login is your user login name (e.g., jdougher.2.cc)login.2.cc to accomplish the goals stated above for this lab (i.e., Lab 2)
moe.cs.haverford.edu (still to be established)'p' to toggle the projection between parallel (orthogonal) and perspective (this will be part of a subsequent assignment) [+5]'n' to undo the last shape added to the universe [+5]myTranslate(...), myRotate(...), myScale(...)) that load and multiply the OpenGL modelview matrix approriately, and call these functions with the appropriate keystroke [+5 per transformation]; XOR ...myTranslate(...), myRotate(...), myScale(...)) from scratch using the vector and matrix classes, and call these functions with the appropriate keystroke [+10 per transformation]Links for CS212 -- Other CS212 Assignments: 0 1 2 3 4 5 6 7
|
|