Homework 7: Light up the World
Short Description:
Extend program six to provide lights.
This assignment is required to complete the special offer.
Goals
When you finish this homework, you should
- Implemented Phong-Blinn lighting.
- Add normals to your js models.
Formal Description
Implement Phong-Blinn lighting in homework 6.
- Extend offTojs
- Compute vertex normals as described on page 295 of the book.
- Access to these normals should be through the member variable .normals
- Modify the ModelDisplay object
- Read the normals
- Transfer these normals to the shaders.
- Modify the shaders
- To store and correctly transform the normals.
- To store and correctly employ all values in the Phong-Blinn lighting equation.
- Modify the SceneObject from Homework 5.
- Add three uniform variables to describe ka, kd, and ks for each surface.
- Add a uniform variable α for each surface.
- Add member functions to manipulate these properties.
- Modify the Display() function to transfer these properties to the shaders.
- Add a light object to your package
- Provide getters and setters to manipulate
- La, Ld, Ls
- Location
- Attenuation variables a,b,c
- Add a Display() method that transfers these variables to the shaders.
- Make sure the light object is declared, provided values and called in your program.
- Modify the objects so each has a different set of material properties.
- Add any other variables or computations needed to complete this project.
Documentation
Your interface should built in a html file. This file should contain documentation discussing the project, including information such as
- Problems encountered
- Interesting techniques employed
- Sources of information
- Collaborators
- Notes on additions
- Screen shots of interesting results.
Please use relative references to your code in the html file. This will allow me to extract the file in my local environment.
Discussion
- You should rename your .js files to be .prog so that the tar file can be submitted trough the email.
- Please include your own .js model files. Make sure that these are in t your directory.
- Please include the common files from ../Common
- Please include the modified source code to offTojs
Submission
When you have finished your assignment, please submit a tar file containing all files needed for this project. Please do not post your project on line until after grades have been assigned.