Live demo | Windows 64-bit download | Linux 64-bit download
My take on making a raycasting pseudo-3D engine in C++, also with my own tiny template linear algebra types. One of the goals was to make raycasting computation equations more explicit and readable. Made first back in 2016 and adding code since to it.
Up/Down
to move andLeft/Right
to turn aroundWASD
to move and strafeM
to toggle mini-mapN
to toggle "Night Mode" and display darkness and lighting effect
- C++17-standard compatible C++ compiler
- CMake 3.16 or newer
That's all. The dependencies are automatically downloaded by Hunter.
mkdir build
cd build
cmake ..
cmake --build . --config Release
For cross-compilation, you can use one of the CMake toolchain files.
TOOLCHAIN=cmake/toolchain/x86_64-w64-mingw32.cmake cmake ..
This project can be built with Emscripten in order to be embedded in HTML. After you set up the Emscripten environment, issue these commands:
mkdir build
cd build
# Workarounds required for Emscripten and Hunter to work together on a local machine.
emcmake cmake \
-DCMAKE_C_ABI_COMPILED=ON \
-DCMAKE_CXX_ABI_COMPILED=ON \
-DCMAKE_CROSSCOMPILING=ON \
..
emcmake cmake --build . --config Release
- http://permadi.com/1996/05/ray-casting-tutorial-table-of-contents
- http://lodev.org/cgtutor/raycasting.html
- http://www.instructables.com/id/Making-a-Basic-3D-Engine-in-Java
- Code-It-Yourself! First Person Shooter (Quick and Simple C++) - by OneLoneCoder (javidx9)
- Free sky texture is from http://www.texturex.com
- Free night sky texture is from https://opengameart.org/content/night-sky-stars-and-galaxies
- Free wall textures are from https://opengameart.org/content/wall-grass-rock-stone-wood-and-dirt-480