Computer Graphics I

4003-570 / 4005-761

Midterm Option: 2D Pipeline Implementation



Date posted: October 5, 2009
Date due: October 21, 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 2D polygons by implementing this pipeline from scratch. The slides describing the pipeline and this assignment can be found here.

Task

Implement the 2D drawing pipeline, which includes transformations, clipping, and polygon scan conversion, 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.

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 Auxiliary Code section below).    

Auxiliary Code:

Below is a list of links to code that will help you in completing this assignment:
 
File Description
myFunctions.c 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.c 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), please use the implementation found in setPixelForWindows.c.
main.c 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.

What to submit

READ THIS SECTION CAREFULLY

Please submit ALL files necessary to build and run the test program. If you are using 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 "2D 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.