The goal of this homework is to implement simple lighting with flat shading. Assume each triangle has the current normal (glNormal must be stored), and the current material (or color if the material is not set). Make sure lighting is only done when the lights are turned on by the program.
Go back to your original model and add mgl calls to light up your space ship. A single well placed light source will be adequate.
HINT: The lighting can be done in the glVertex method and the results can be passed to your drawing routine (this will result in the least amount of code modification).
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.
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). 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.