Raycasting is a rendering technique used to create a 3D perspective in a 2D map. This code uses the DDA (= Digital Differential Analyzer) algorithm. The rendering is done using the SDL2 library.
- Install the C++ compiler g++ using the following command:
sudo apt-get install g++
g++ --version
- Install the SDL2 library using the following command:
sudo apt install libsdl2-image-dev
- Clone the remote repository to your local machine using the following command:
git clone https://github.com/frederic-hallein/raycasting
- To compile the project, go inside the
raycasting/
directory and run the following command:
make all
main
executable file in the same directory.
- Run the executable by using the following command:
./main
Character control is done using the wasd
keys.
w
: forward movementa
: backward movements
: left camera rotationd
: right camera rotation