3D rendering from scratch in C
ascii_cube.mov
Screen.Recording.2024-04-24.at.15.18.14.mov
Supports rendering in both terminal ASCII and GUI
Render in terminal ASCII:
$ mkdir bin/
$ make all MODE=release
$ ./bin/ascii3d
Render in GUI window (using raylib to draw the pixels into a window):
$ mkdir bin/
$ make libs
$ make all MODE=release RENDER_MODE=raylib
$ ./bin/ascii3d
The GUI version currently only builds on macOS and Linux due to dependency managing, but the ASCII supports pretty much anything.
You could also try using yeb for building, which is a build system in C that bootstraps itself from a single header file:
# Bootstrap yeb
$ cc build.c && ./a.out
# ASCII:
$ ./yeb/yeb --release
$ ./bin/render
# GUI:
$ ./yeb/yeb libs
$ ./yeb/yeb --release --gui
$ ./bin/render
This repo is licensed under GPLv3