A 3d software rasterizer engine written in C following 42-guidelines. A raycast method is used for 3d effect.
Features:
- Raycasted 3D
- Parallel rendering
- Depth shading
- Option for simple normal mapping
- Map editor
.obj
file import and usage for world generation- homemade 3d models :)
- AABB collision (player)
- AABB viewbox occulsion
- Skybox
- Minimap
WASD: Move
Mouse: Rotate
n: toggle normal maps
p: pause game
f: set full screen mode
esc: quit
Arrows+Enter: In menus, move and select
git clone https://github.com/hakolao/wolf3d-rasterizer && cd wolf3d-rasterizer
make && ./wolf3d
sudo apt update
sudo apt-get install xorg-dev # make sure x11 related stuff is installed
# install sdl
sudo apt-get install libsdl2-dev
sudo apt-get install libsdl2-ttf-dev
sudo apt-get install libsdl2-image-dev
# install vcxsrv on windows side & run it
export DISPLAY=:0
export LIBGL_ALWAYS_INDIRECT=1
# run wolf3d
git clone https://github.com/hakolao/wolf3d-rasterizer && cd wolf3d-rasterizer
make && ./wolf3d
Install SDL2, SDL_image, SDL_ttf on linux.
sudo apt update
sudo apt-get install libsdl2-dev
sudo apt-get install libsdl2-ttf-dev
sudo apt-get install libsdl2-image-dev
Then play the game :)
git clone https://github.com/hakolao/wolf3d-rasterizer && cd wolf3d-rasterizer
make && ./wolf3d
A simple map editor to generate levels for wolf3d.
make map_editor && ./wolf3d_editor #default size of 15x15
./wolf3d_editor --filename=maps/map_name_here --size=1-50
Add your map file to src/scene/scene_data.c
data->map_filename = ft_strdup("maps/level1");
Then recompile
make && ./wolf3d
- SDL: Window management, fonts, events, time and presenting the framebuffer
- All graphics are software rendered
- Libc:
pthreads.h
for parallelizationstdlib.h
:malloc
,free
,exit
stdarg.h
: variable length inputsstdint.h
andfloat.h
: typesfcntl.h
:open
,close
- lib3d: 2D and 3D functionality, rasterization, 3d object representation & reading etc.
- libgmatrix: matrix and vector math library
- libft/hash_map
- libft/thread_pool