EXERCISES FOR WEEK 9
week9-1

For this paper/pencil/calculator exercise, assume the following:

  • There is one positional light, with these properties:
    • Diffuse Intensity (RGB) = (1.0, 0.8, 0.6) ;
      Specular Intensity (RGB) = (0.9, 0.85, 0.2);
      Ambient Intensity (RGB) = (0.6, 0.4, 0.4)

    • light position (x,y,z) = (4, 12, 2)

    • eye position (x,y,z) = (-3, 2, 5)

  • There is a global ambient light (RGB) = (0.2, 0.2, 0.2)

  • There is a facet whose color (RGB) will be caculated using the Phong Lighting Model and these facts:
    • a vertex on the facet has coordinates = (0,0,0)
    • the normal vector to the facet at this vertex = <-1, 1, 1>
    • the material of the facet has these properties:
      • material diffuse coefficient (RGB) = (0.8, 0.5, 0.3)
      • material specular coefficient (RGB) = (0.8, 0.5, 0.3)
      • material ambient coefficient (RGB) = (0.8, 0.5, 0.3)
      • material Phong exponent = 57.0
  1. What is the vector s from the vertex to the light source?
  2. What is the length of vector s ?
  3. What is the normalized vector Us ?
  4. What is the vector  v from the vertex to the eye?
  5. What is the vector h (the vector halfway between vector s and vector v?
  6. What is the length of vector h ?
  7. What is the normalized vector Uh?
  8. What is the vector  m (the vector normal to the face at the vertex)?
  9. What is the length of vector m ?
  10. What is the normalized vector Um ?
  11. What is the value of Lambert?
  12. What is the value of Idiffuse (RGB) ?
  13. What is the value of Phong?
  14. What is the value of Phong f
  15. What is the value of Ispecular (RGB) ?
  16. What is the value of Iambient (RGB) ?
  17. Finally, what is the value of I (RGB) at this vertex?

 

week9-2

Compile and run the program 2spheres_b.cpp.

  • Change the materials properties
  • Change the light properties (from the default, which is used)
  • Change the position of the light

Make sure you understand how the changes affect the spheres.