This program has been developed to simulate ray-casting algorithmic process in 2D and pseudo-3D spaces.
Ray-casting is one of the computer graphics rendering methods that uses rays (vectors) to detect intended target objects within specified field of view.
Although conventional methods utilize discretized intervals to detect objects along the ray's trajectory, this program searches for ray's intersecting points and computes the nearest one from itself. The purpose of the nearest intersection point search is to render only the parts of the ray from the light source to the point of intersection, thereby demonstrating an example of light & shade perception.
[1] Computation of line-to-line interception point --> iteratively updates the interception points to derive the perception of "bright" and "dark" regions using line segments called "rays" emerging from the "light source".
[2] Heuristic method used to map ray-casting phenomena into pseudo-3D perspective.
- Use mouse to move the light source around the screen (within the 2D viewer).
- Use left mouse button to switch between different view modes (pseudo-3D perspectives).
- Use A or D keys to rotate the light source.
- Use R key to reset the environment.
- Use C key to change the color of rays and collision spots.
- Use Z key to tune field of view angle.
- Use X key to quit.