Simple 2D raycasting program written in C++.
-
Draw polygons, which represent walls to block light and one "fake" polygon which serves as a border.
-
Cast rays form light source point to each polygon's vertices + for each ray cast 2 copies rotated by +- 0.0001 radian.
-
Find intersection point for all rays and all polygons and for each ray save the closest one to light source.
-
Connect all points and fill it to draw lighted area.
-
You can add more light sources to create "fuzzy" shadows.
There are 20 additional light sources on image, which are located in circle shape, center of which is original light source.
