This homework assignment has three tasks. The first two are intended to familiarize you with the OpenGL examples in the source directory. The third task is to convert your program from homework 1 to use OpenGL and display the geometric object you created.
Task 1: Login to one of the machines in the graphics lab (room 237) and download the source.tar file from the class website onto your machine. Extract the files using "tar xvf source.tar" or by double clicking on the source.tar file and draging the source folder to your desktop. Change directories into source and run "make" to compile the OpenGL examples. Now run each of these programs. Hopefully you will see a graphics window. See what happens when you drag a corner to resize the graphics window. Take a look at the source code of "disk.c" to see if you can find the code that causes the changes you see.
Task 2: Take a look at the source code "cube.c". You will see that this program calls an "init" and "draw" function in the "main" function like the other examples in class. There is also a "cube" function that generates the six polygons that make up a cube. Modify this program to:
Task 3: Convert your program from homework 1 into an OpenGL program that displays your geometric object. Since you were not able to "see" your geometric object in homework 1, there may be errors in your original coordinate calculations. Correct these mistakes as needed.
The design portion of this programming project is relatively minor. Your primary tasks are to decide which OpenGL graphics primitives map best to your object (GL_POLYGON, GL_TRIANGLES, etc) and what colors to use to draw your objects.
Your primary implementation task is to covert "printf" commands into OpenGL function calls. You may also want to "repackage" some of your homework 1 code if it was not modular enough for this assignment (ie add functions for each object).
Students are always welcome (and even encouraged) to make use of the OpenGL sample programs on the class website as a starting point for their projects. The "cube.c" program is probably the closest to what you need to complete this assignment. In particular, there is some OpenGL code in the "init" function that sets up a side view of the cubes so we can see multiple faces.
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.
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.
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.