This projects aims to simulate lenses, giving us power to distort and change focus of a scene. Each lens is essentially a collection of sphere-parts. Thus, first I first traced each ray through the sphere-parts. When a ray intersects with a sphere-part, Snell's law was used to determine the refracted direction of the ray. A lot of math then is used to determine the focal point of each lens.
All credits for the project are reserved to UC Berkeley CS 184 with professor Ren Nguyen.