Computer Graphics I

4003-570-01 / 4005-761-01 (Fall 2007)

Midterm Option: 2D Pipeline Implementation



Date posted: September 26, 2007
Date due: October 12, 2007


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 this pipeline and this assignment can be found here.

Task

You will be asked to 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 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.  NOTE: the correct implementation of setPixel() has been uploaded on 10/15/07.

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

You will be submitting the following files:

Filename Description
myFunctions.c Contains implementations of the routines that need to be written.  Feel free to use the supplied myFunctions.c as a template, replacing the original code with your implementation
aux files Any additional files that  might be needed for your implementation (optional)
README Indicate on what platform you tested your implementation and provide additional info I may need to know (e.g. auxillary libraries used) in order to build and run your assignment.

All submission should be made using mycourses.   Look for the folder named "2D Pipeline" 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. 

last updated 09/26/07