The goal of this homework is to create a new class derived from the minigl class. In this class you will begin to provide the methods to implement an OpenGL renderer. You should start with the cs4731GL.h and cs4731GL.cpp files which are just copies (with renamed classes) of openGL.h and openGL.cpp. You will then begin replacing code as appropriate.
Our goal is to reduce all drawable primitives to triangles, which we will then process through the rest of the graphics pipeline. To accomplish this, we want to take each of the triangle and polygon generation operations and convert them into calls to generate simple triangles (i.e., not strips). In later assignments we will then process these triangles further.
Provide your own implementations for the mglBegin/mglEnd calls. These will not yet be full implementations. For this homework, you will be converting all primitives available to sets of triangles. For instance, each QUAD in a QUAD_STRIP will be broken into 2 triangles. This will require you to keep lists of all glVertex3f calls (you can use STL here) after the glBegin. When glEnd is reached, convert all of the specified vertices into openGL triangle calls.
HINT: You will probably need to keep track of the current mode of primitive being drawn between mglBegin and mglEnd.
HINT: The only openGL primitive commands you can use will have the form:
Requirements:
The homework is due at the start of class on Friday.
Use the code from the previous assignment. Develop supplementary classes to help with the current task. There is a supplied vertex class as an example.
You will submit a tar file containing all of the source code, a Makefile and a README file. The source code must compile (and run) on a CCC machine. Feel free to develop on any platform you like, just make sure things run on ccc before submitting. The program should compile when make is invoked on the command line in the directory with your code. Submissions which do not compile when make is typed, or do not run successfully, will not be graded and given 0 points.
The README file should contain an extensive description of what you are handing in, the layout of your code (what you have changed, what files you are submitting, and a discussion of the overall algorithm). Also, if you are working with a partner, please include his or her name. This README file will count towards your grade. Submissions without a README or submissions with a worthless README will not be graded and given 0 points.
Submittal will be made using the turnin program. Here are the commands (on ccc) you will use for a submittal:
Each homework assignment is graded on a 10 point scale (this is 10 points towards your final grade). 6 points will be graded for functionality: the program does what the assignment requests. 2 points will be based on documentation in the README, and 2 points will be based on the quality of your design and coding style.
You will loose 1.5 points for handing the assignment in late. The late period for each hw is always until the start of class on the following Monday. Any assignment not handed in by Monday is a zero.
Since a grade of 0 will be given if the code does not compile and run, it is in your best interest not to submit anything until you have completely tested and evaluated what you have written.