@Author: Ruksana Kabealo
In this assignment, I implemented a ray tracer that renders a scene with three spheres and two planes. The scene is lit by a single point light source. The objects in the scene are shaded using the Phong reflection model.
The code is provided in the included Jupyter Notebook. Running the code as is will produce 200 512x512 PNGs of the rendered scene as the light source moves in a parabolic arc described by v = -0.00024*u^2 + 240 + 0.0001 (from point (0.0001, 0.0001, -999.9999) to point (0.0001, 4.776099999999982, 990.0001), reaching a maximum height at point (0.0001, 240.0001, 0.0001)) from behind the objects to behind the camera. Note that the w coordinate is fixed at 0.0001, so the light source only moves up/down and back/forth and never left/right. This animated light source is meant to mimic the cycle of the sun rising and setting.
All images are not included in the repository due to their size, but all images can be generated by running the code. To generate all 200 images, the code takes approximately 5 minutes * 200 images = 1000 minutes = 16.67 hours to run on my machine. Alternatively, in Google Collab the code takes approximately 1 minute * 200 images = 200 minutes = 3.33 hours to run.
An animation of all the images stitched together is hosted at the following link: https://www.youtube.com/shorts/dhx-upeSCUI
The first image in the video. Here, the light source is located at the starting point of its parabolic arc (behind the objects).
An image from 1/4 of the way through the video. Here, the light source is located halfway between the starting point and the maximum height of the parabolic arc.
An image from 1/2 of the way through the video. Here, the light source is located at the maximum height of the parabolic arc.
An image from 3/4 of the way through the video. Here, the light source is located halfway between the maximum height and the ending point of the parabolic arc.
The last image in the video. Here, the light source is located at the ending point of the parabolic arc (behind the camera).