CSCE 4813 - Homework 3
Due Date - Oct 15, 2008

1. Problem Statement:

The goal of this assignment is to become more familiar with geometric transformations in OpenGL and user interaction via callback functions. Your task is to extend the "cube.c" program (or any other sample program in the source directory) to allow users to rotate and translate objects on the screen using both the keyboard and the mouse. To accomplish this, you will need to add:

to your main program and implement the corresponding functions:
   void keyboard(unsigned char key, int x, int y) { }
   void mouse(int button, int state, int x, int y) { }
You may need to add several global variables to your program to maintain rotation and translation parameters and modify the display() callback function accordingly. By adding a call to
in these functions, you can force your geometric model to be redrawn without explicitly calling the your display() callback function.

2. Design:

There are a lot of design issues for this assignment. First, are you going to use the keyboard for rotations and the mouse for translations, or the mouse for rotations and the keyboard for translations? Second, what characters will you use to control the rotations or translations? Third, how will you convert mouse clicks and motions into object rotations or translations? Try to come up with simple solutions from both the user's perspective and from an implementation perspective.

3. Implementation:

You may want to implement your solution in phases, with keyboard operations first and mouse operations second, or rotations first and translations second. Choose an implementation order that makes the most sense to you, and "grow your solution" incrementally. As a general principal, you will receive more credit for a working program that completes 1/2 the tasks than you will for a non-working program that attempts all of the tasks.

4. Testing:

Test your program to check that it operates correctly for all of the requirements listed above. Also check for the error handling capabilities of the code. Save your testing output in text files for submission on the program due date.

5. Documentation:

When you have completed your program, write a short report (less than one page long) describing what the objectives were, what you did, and the status of the program. Does it work properly for all test cases? Are there any known problems? Save this report in a separate text file to be submitted electronically.

6. Project Submission:

In this class, we will be using electronic project submission to make sure that all students hand their programming projects and labs on time, and to perform automatic analysis of all programs that are submitted. When you have completed the tasks above go to the class web site to hand in your documentation, program, and testing files. You are welcome to use either the "submit" or the "file upload" method.

The dates on your electronic submission will be used to verify that you met the due date above. All late projects will receive reduced credit (50% off if less than 24 hours late, no credit if more than 24 hours late), so hand in your best effort on the due date.

You should also PRINT a copy of these files and hand them into your instructor in the department office. Include a title page which has your name and uaid, and attach your hand written design notes from above.