Field of Vision | Visibility Algorithm

by Hanzhe
See inside

Here's an algorithm on Field of Vision, or visibility algorithm. This generates visible areas and non-visible areas (shadows).

Visible areas are where the player can see, and are shown in white.
Non-visible areas are the dark portion of the map.

Use a/w/s/d to move, use your mouse to generate walls. Use the map variable to switch between maps.

Notes and Credits

All code and art by me.

Welp, this took me a while. Idk how this can be used in a game or anything but whateves. Let me know if there's a faster way to draw triangles. (see the triangle drawing function inside)

- Improved the speed by a bit.

Shared: 15 Sep 2017 Modified: 17 Apr 2018
Favorite this project 36
Love this project 76
Total views 569
View the remix tree  2
More projects by Hanzhe