CSCE 4813 - Homework 1
Due Date - 11:59pm on Jan 25, 2010

1. Problem Statement:

The goal of this assignment is to build some simple geometric models to be used in future graphics programs. Your task is to write a C program that generates a polygon based model of a man-made geometric object, such as a table, chair, book case, or something else you might find around your house. Your program should prompt the user for any input parameters (eg. the size or position of the object). The program should output a collection of polygons with 3D floating point vertex coordinates. For example, the six faces of cube would be output as:

   polygon
      0.0 0.0 0.0
      0.0 1.0 0.0
      1.0 1.0 0.0
      1.0 0.0 0.0
   end
   polygon
      0.0 0.0 1.0
      0.0 1.0 1.0
      1.0 1.0 1.0
      1.0 0.0 1.0
   end
   polygon
      0.0 0.0 0.0
      0.0 0.0 1.0
      1.0 0.0 1.0
      1.0 0.0 0.0
   end
   polygon
      0.0 1.0 0.0 
      0.0 1.0 1.0 
      1.0 1.0 1.0
      1.0 1.0 0.0
   polygon
      0.0 0.0 0.0
      0.0 0.0 1.0
      0.0 1.0 1.0
      0.0 1.0 0.0
   end
   polygon
      1.0 0.0 0.0
      1.0 0.0 1.0
      1.0 1.0 1.0
      1.0 1.0 0.0 
   end

This output format is intentionally similar to the OpenGL syntax for specifying GL_POLYGONS. Your next programming project will convert the printf statements above into OpenGL commands to display your geometric object on the screen.

2. Design:

The hardest part of this programming project will be deciding on the most natural coordinate system to describe your geometric object and taking the measurements of all of the pieces that make up your geometric object. Once you have this figured out, see if you can map these pieces into C or C++ function calls with appropriate parameters to control the size and position of your geometric object. For example, functions to output the legs of your table, or shelves in your book case. The implement you main program using these functions.

3. Implementation:

Since we are not using OpenGL for this project, you are welcome to implement your program on any CSCE computer you have access to. My standard advice is to develop your code incrementally so you always have something that compiles and runs, even if it is not complete.

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 "submit" your documentation, program, and testing files.

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 class or in the department office. Include a title page which has your name and uaid, and attach your hand written design notes from above.