COM 1370 Computer Graphics - Summer 2001 - Final Assignment, #6
Professor Futrelle -- College of Computer Science, Northeastern U., Boston, MA
Assignment due end of Thursday, August 23rd
Updated Friday 8/10/2001
This assignment is due electronically by the end of the day (midnight)
Thursday 8/23.
Remember, turn in whatever you have done by that time.
Overview
This is part three of a three-part assignment.
This part will involves rotation of
a polyhedron in three dimensions with illumination (lighting) sources.
So what is added to the previous assignment, in this one, is illumination.
It is the last assignment of the Quarter, which is obvious from the due date.
Do the following for a basic C grade.
(An excellent job on this part could get you more than a C, e.g.,
a clean and clear and well-organized and commented system.)
-
Create a tumbling polygon, as in part two (use the same code, that's fine).
Assume there is a single white light source pointing from the right
and directed along the x-axis (the unit vector to the source, L,
is simply 1,0,0.) Its intensity will be 1.0.
Calculate the illumination level, I, of a face as I = 0.1 + 0.9 x L·N,
where N is the unit normal pointing out of the face. Assuming you have some
Color value for the face, C, multiply each component by I to produce the
final intensity for each color component for that face.
For a higher (B) grade:
-
Create two light sources of different colors and directions.
For example, one might have L1 = 2,0,1, before normalization.
That source would be on the right, and your other source could come from
the left or above, for example.
Assume an ambient
lighting Ia with some Color value. Assume each light source has its
own distinct color value. For example, a red source, Color(1.0,0.0,0.0).
Calculate the illumination of a face for each of the three color components
as the weighted sum of the ambient illumination and the two light sources, each
weighted by the dot product between the surface normal and the respective L vector.
You will want to treat the intrinsic color of the face as a reflectivity, so
the intensity of each of the three color components will involve the product
of the illumination intensity of that component and the coresponding reflectivity component.
Adjust the weights to get a nice looking display.
To produce cleaner code, you might want to define 3-component vectors representing
colors and do all your color computations as weighted sums of these vectors and
the appropriate component-by-component products for the reflectivity x illumination
values.
For the highest (A) grade:
-
Use mouse interaction to allow the user to
alter either the direction of one of the light sources, or some combination of
the direction and intensity, e.g., mouse-x could adjust an angle and mouse-y
the intensity of a source. This might look more striking if only one source
was used. You could try having the polyhedron motionless while moving the
source, as one option.
See the page on electronic handins for the correct way to set up your
directories and files for your electronic handins.
Go to COM1370 home page
Return to Prof. Futrelle's home page