CSCE 4813 - Homework 1
Due Date - 02/09/2012 at 11:59 PM

1. Problem Statement:

The goal of this programming project is to give students exposure to the OpenGL library for rendering images, and also some experience building geometric models. Your task is to design a one story building without a roof so you can see the hallways and rooms inside. In future assignments you will put furniture and other objects in the rooms and allow users to interactively 'walk through' your building to see what it looks like.

2. Design:

To start with, draw a top view diagram of you building on graph paper to show where the exterior and interior walls will be, and where you want doors and windows. To keep things simple, I suggest that you make your walls parallel to the x and y axis. Once you have finished your drawing, write down the (x,y) coordinates of the start and end points of all wall segments. Your next design task is to figure out how to convert this 2D line segment information into a 3D house model.

To start with you could create zero-thickness walls by turning each line segment into a 3D polygon by adding z coordinates for the top and bottom of each wall. By drawing these polygons in the "display" callback you will get a chance to see what the building looks like and correct any errors.

To create a 3D building model, walls should be represented by 3D slabs that have thickness T. To model these slabs you will need 6 polygons per slab (front, back, left, right, top, bottom). I suggest you design a "wall" function that takes 2D line segment information to generate the 6 polygons above. Calling this function N times in your "display" callback will create images of your 3D building model.

The program "office.cpp" can be used as a starting point for your OpenGL program. You can keep the "init", "keyboard" , "display" and "main" functions and discard the rest. Then modify "display" to call you new functions to draw your building model. The "keyboard" function is set up to rotate the model in the x,y,z directions when the user types in 'x', 'X', 'y', 'Y', 'z', 'Z'. This should give you a chance to better examine your building model.

3. Implementation:

You can implement this program using either a bottom-up approach or a top-down approach. If you go for a bottom-up approach, start by creating basic methods and classes, and test theses methods using a simple main program that calls each method. When this is working, you can create the main program that uses these methods to solve the problem above.

If you go for a top-down approach, start by creating your main program that reads user input, and calls empty methods to pretend to solve the problem. Then add in the code for these methods one at a time. This way, you will get an idea of how the whole program will work before you dive into the details of implementing each method and class.

Regardless of which technique you choose to use, you should develop your code incrementally adding code, compiling, debugging, a little bit at a time. This way, you always have a program that "does something" 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. Try your program on 2-3 input documents, and save your testing output in text files for submission on the program due date.

5. Documentation:

When you have completed your C++ program, write a short report describing what the project objectives were, what you did, and the status of the program. Does it work properly for all test cases? Are there any known problems? Include screen shots to show what your program outputs. Save this report in a separate document 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, C++ 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 teaching assistant in your next lab. Include a title page which has your name and uaid, and attach your hand written design notes from above.