This applet allows you to experiment with various parameters of a
lighting model. The relevant reading is paragraph 14.2 of Hearn &
Baker, especially pages 497-504. A few notes:
- There's one light in the scene, at the position of the white cross-hair.
The light is white, and its intensity is
- Specular highlights are done using Phong's shading model.
- The spheres
are raytraced individually, going from the furthest to the closest sphere.
This means you won't see any shadows.
- If you run this applet on anything less than a 24-bit colour
display, the resulting pictures are not going to be that pretty.
- When running this applet under older versions (< 4.x) of
Netscape, the function
"copy image to window" doesn't work properly: whenever it is redrawn,
it shows the current picture. When run using the Appletviewer, it
should work fine though.
Click here for a list of all applets.
For those of you without the book, an explanation of the lighting model parameters:
|k_a||material's ambient coefficient|
|I_a||ambient light (R, G and B)|
|k_d||material's diffuse coefficient|
|I_l||light (at crosshair) intensity (R, G and B)|
|N||surface normal at point of intersection|
|L||vector to light from point of intersection|
|k_s||material's specular coefficient|
|V||vector to viewer from point of intersection|
|R||vector L reflected at point of intersection|
|n_s||material's specular reflection parameter|
Patrick Min, CS Department, Princeton University
Last modified: Mon Jan 18 15:18:29 EST 1999