Raycasting
Demonstrates raycasting.
Open in new tab
Tags: calculation graphics math simple
Open in new tab
A point is selected as the origin, either the center of the canvas or the mouse position. It then calculates the rays cast from that point and where they intersect with the other lines on the canvas.
After completing a cycle, it clears the rays and reselects its origin point. Reloading the program will cause the black lines in the canvas to randomize.
Tags: calculation graphics math simple