February 2019
Intermediate to advanced
292 pages
6h 55m
English
Either the ray misses the cylinder or it hits the cylinder. Right? This dichotomy neatly describes the tests you’ll write first. You’ll start by confirming that a ray misses a cylinder. Such tests can be made to pass trivially, but rather than passing them by making your local_intersect method do nothing, this provides a good opportunity to start actually implementing the intersection routines.
Show that the local_intersect function correctly identifies when a ray misses a cylinder.
This test creates a cylinder and casts three different rays at it. The first ray is positioned on the surface and points along the +y axis, parallel to the cylinder. The second is inside the cylinder ...
Read now
Unlock full access