Having a point light source will affect the light vector. With directional light sources, you have the same light vector for all the lighting calculations. With point light sources, you will need to find the light vector between (a) a point on the surface and the point light when doing Phong shading, (b) a vertex and the point light when doing Gouraud shading, and (c) center of the polygon and the point light when doing flat shading.
Introduce another geometry in addition to the cylinder. Use the sphere model from chapter 8 of Matsuda and Lea. The sphere will be used to represent the position of the point light. Size the sphere so that it's visible in your world. Allow the user to move the sphere around. You should see the effect of point lighting in the scene.
Rubric:
You start off with 100 points. You lose credit for missing functionality, incorrect results, poorly documented or formatted code, or not following instructions. Below is a partial list: - up to 10 points off for poor features.html file, or inadequate comments or bad code - up to 10 points off for not following instructions or needing special handling to grade your homework. - functionality points depending on importance (remaining 80 points) For this program, building upon your previous assignment (i.e. you can create an object with at least 2 cylinders), new functionality requirements are: - Light sources: (25 points) directional lighting: 10 point light source: 10 combined: 5 need toggle to turn on/off different light sources - Light effects: (25 points) ambient: 5 diffuse: 5 specular: 10 combined: 5 need toggle to turn on/off different light effects * ambient is independent of light source(s) * to check specular, need to modify gloss factor and either light(s) or viewer (can skip test on latter for now) - Shading: (30 points) wireframe: 5 flat: 5 gouraud/phong: 15 (pick one, or both) combined: 5 need toggle to turn on/off different shading effects * incorrect vertex normals will affect more than 1 shading option Make sure you: a. submit the right files you want us to grade, b. have tested your code on the browsers in the lab. c. follow the general instructions described in overview.html
Nicholas Tee: ntee@ucsc.edu
Put materials in a folder named prog3 and zip it up.
Last modified
Monday, 31-May-2021 08:04:43 PDT.
Read the
for instructions on how to submit your work.