Computer Graphics I

4003-570 / 4005-761

Final Exam Option: 3D Pipeline Implementation


Date posted: October 28, 2009
Date due: November 16, 2009
Submit to the dropbox on the myCourses website


Purpose

The purpose of this project is to gain an appreciation and understanding of what OpenGL does to render 3D objects by implementing the 3D rendering pipeline from scratch.   The slides describing this assignment can be found here.  

Task

You will be asked to implement the 3D drawing pipeline, which includes transformations, camera models, projection, and a Z buffer scan line algorithm, from scratch.   Your implementation cannot make use of any OpenGL routines.  Instead, you should make use of the method setPixel(x, y, r, g, b) which will be provided for you.  (See auxiliary code section below).   In implementing this pipeline, you are encouraged to make use of the 2D drawing algorithms that you implemented in Assignment 2  as well as the framework created for the 2D Pipeline Implementation.

Functions that you will be asked to write are modeled after OpenGL routines that perform similar tasks. Descriptions of the routines can be found in the comments of the file myFunctions.c (see Code section below).    

Auxiliary Code:

Below is a list of links to code that will help you in completing this assignment. Note that although all of the files are written in C, they have been named as C++ files and tested using g++ as a compiler.

File Description
myFunctions.cpp Defines the functions that you will need to implement with default implementations that do make use of OpenGL.  Your task is to replace these default implementations with your own code.
myFunctions.h Header file with external declarations of the functions in myFunctions.c
setPixel.cpp Implementation of setPixel().  Recall that you must use this function in your implementation.  No OpenGL calls allowed!  Note that this version of setPixel()differs from that in Assignment 2 in that you can specify a color in which a pixel will be drawn.

For those using systems that don't support the glWindowPos() function (default Window system and OpenGL on the Suns), please use the implementation found in setPixelForWindows.cpp.
main.cpp Main function for a  simple test program that you can use to test your implementation. Note that by compiling and running this program using the unmodified myFunctions.c, you can view correct output to which you can compare the results of your implementation.

If you want all of the above files in a single download, here they are in zip and tar format.   If you are developing on the Sun workstations under Solaris, here is a header.mak file that can be used in conjunction with makemake or gmakemake pointing to the correct library and include directories for OpenGL.

What to submit

READ THIS SECTION CAREFULLY

Please submit ALL files necessary to build and run the test program. If you are using C or C++, you must also include the auxiliary files provided above. If you are using another language, you must provide the rewritten versions of these files.

When using IDEs like Visual Studio or XCode, please zip and submit the entire project folder (including the executable). This greatly simplifies the grading process.

Finally, your submission must include a README that indicates the platform on which you tested your implementation and provides detailed instructions for building and running your submission.

All submission should be made using myCourses. Look for the folder named "3D Pipeline Implementation Option" in the dropbox area.

Assessment

Your grade will be based on your reimplementation of the required routines and their usability with the supplied test programs.