February 2019
Intermediate to advanced
292 pages
6h 55m
English
A ray tracer computes shadows by casting a ray, called a shadow ray, from each point of intersection toward the light source. If something intersects that shadow ray between the point and the light source, then the point is considered to be in shadow. You’re going to write a new function, is_shadowed(world, point), which will do just this.
Implement the following four tests, which demonstrate four different scenarios. Each assumes the existence of the default world that was defined in Building a World.
In the first test, the world is set up like the following figure.

Nothing at all lies along the line connecting the point ...
Read now
Unlock full access