Due: Thursday, September 2nd, 2010 (before lab session ends)
Create the program, polygons, that reads in a data file containing a list of vertices and draws them using different OpenGL polygon primitives as shown below.
The input file will consist of a set of data points in the following format:
x0 y0 x1 y0 ...
An example is the following:
2.0 0.0 4.0 0.0 6.0 2.0 6.0 4.0 4.0 6.0 2.0 6.0 0.0 4.0 0.0 2.0
Your program should draw the input data using the following methods:
All of the different primitives should be displayed in one window with each method in its own separate viewport. Likewise, use a different color for each successive vertex (you may rotate through a fixed set) to achieve the gradient effect shown above.
To specify the input data file, your program should have at least the following command line interface:
usage: polygons [options] <datafile> Options: -h Show this help message
An example invocation would be:
$ ./polygons input.data
Feel free to add additional flags and options to modify your programs behavior at runtime.
Demonstrate the polygons executable to the instructor or TA before the lab session is over. Once verified, place the source code and Makefile in your course dropbox:
/afs/nd.edu/coursefa.10/cse/cse40166.01/dropbox/<afsid>/lab2