/raycasting

Raycasting example

Primary LanguageJavaScriptGNU General Public License v3.0GPL-3.0

raycasting

Raycasting example


Raycasting is a rendering technique to create a 3D perspective in a 2D map. Back when computers were slower it wasn't possible to run real 3D engines in realtime, and raycasting was the first solution. Raycasting can go very fast, because only a calculation has to be done for every vertical line of the screen. Left side shows the 2D view, top down. Right side shows the 3D perspective view.


Todo

  • Populate directory with source files.
  • Create slider for field of view (player.fov)
  • Load map from file
  • CSS
  • Embed in blog
  • Full description of raycasting and code.