Description
The purpose of this assignment is to complete a ray tracing program that displays
spheres and computes shadows generated by objects.
For this purpose, you are required
to:
Add a method minimumIntersection to the class cameraMatrix.
For a given ray, this method
finds the t-values of the intersections that the ray makes with the objets in the
scene. It returns the minimum tvalue, along with the object for which this
intersection belongs.
Complete the constructor and the helper method in class shader. For a given ray (and
its corresponding pixel (i,j) in the image) the constructor computes the color for the
pixel (i,j) by applying a shading model identical to that employed in Assignment 3.
The helper method __shadowed determines if a particular pixel in in the shadow of
other objects, or itself. It does so by forming a ray from the intersection point in the
direction of the light source. If any object is intersected by the ray, then the pixel is
in shadowed, and the pixel is shaded using ambient light only.
In order to program this properly, algorithms for the method minimumIntersection, the
class shader constructor, and its helper method __shadowed are provided in this
document.
Here are some general considerations concerning this assignment:
The sum of the Python code needed for this assignment can be found in OWL under
Resources, Python Code, Assignment 4.
You must not change the provided classes that are complete, nor the provided file
names and class names. In addition, exactly follow the instructions as to the
naming of the files and classes you will have to program for this assignment.
The test program for this assignment is Assign4.py and is found with the rest of the
provided code.
Executing Assign4 should result in an image identical to this one
Use OWL to submit the file myAssignment4.py. This file must contain the following
classes:
cameraMatrix
shader
You must use Python 3.7 and PyCharm 2018.2 or above for this assignment. Before
submitting your assignment, please refer to the assignment marking scheme and
submission guidelines.