March 2017
Intermediate to advanced
480 pages
11h 3m
English
A ray is represented by a point in space and a direction. The ray extends from the point to infinity in the given direction. For our purposes, the direction of a ray is always assumed to be normalized:

We are going to declare a new Ray structure. This new structure will consist of a Point representing the origin of the ray and a vec3 representing the direction of the ray. It is assumed that the direction vector will always be normalized. We will also implement a helper function to create a ray given two points.
Follow these steps to implement a 3D ray:
Ray structure in Geometry3D.h:typedef struct Ray { ...Read now
Unlock full access