Computer Science 155: Graphics 
Fall 2000 
Homework 3


This assignment is due by the start of class on Wed., Oct. 4.  Please put your name, name of program, and compiling instructions at the top of your files. In addition, describe the features you've implemented and comment each function (explaining briefly what it does and what its arguments are).  You should provide sufficient additional comments for the graders to understand the logic of the program. 

  The objective of the assignments for the next 2.5 weeks is to implement a graphics pipeline that draws a polygon mesh entered by the user. For the first part of the assignment we will focus on constructing the pipeline for a single polygon. You will read in a polygon represented by vertices in 2D model coordinates. You should convert each vertex to 3D homogenous model coordinates. (Situate the polygon in the z=0 plane.) When the users asks that the polygon be drawn you should process the vertices through the graphics pipeline.

  The steps of the pipeline are:

Your program should read in the vertices of a polygon from a file called "polygon.dat". The user is allowed to specify the color of the polygon (white, black, red, green, blue), and how the polygon should be transformed in 3D space via rotations, translations, and scaling. The user will also specify the type of projection to be used; i.e. orthographic or perspective. For the current asignment you are only required to implement orthographic projection. In the case of orthographic projection the user will specify the distance between the near and far planes. The near plane is always at z=0.