CMPS 160 -- Lab 4

Early if time stamp is before midnight Nov 16, 2019.
On time if time stamp is before midnight Nov 17, 2019.
Late submissions will not be accepted/graded.

Objectives:

Add a second light that can be moved around.

Description:

Up until now, we had a white directional light source coming from [1,1,1]. For this assignment, you will add a point light source. This light source casts a bluish hue (0.5,0.5,1) and its initial location is at (0, -100, 100). This light source is also represented by a yellow sphere with radius = 5. Like the directional light source, this point light source is turned on by default.

Allow the user to turn this light on or off by clicking on the yellow sphere (as opposed to clicking on a toggle button). Note that the yellow sphere is lit only by the directional light. All other objects in the scene are lit by both light sources if the point light source is turned on, otherwise they are lit only by the directional light.

Moving light source. Allow the yellow sphere to be translated. Use the same controls that you used for translating trees in Prog 3. As the yellow sphere is moved around, you should also update the lighting of all the objects in the scene.

Lighting should include both diffuse and specular reflections. The rendering mode can be adjusted as before by cycling through the different options.

Resource:

Grading:

Submission:

See course overview for instructions on what to submit and what not to submit.

Put materials in a folder named lab3 and zip it up. Submission must be done using Canvas.


Last modified Monday, 04-Nov-2019 15:37:30 PST.