A rotating 3D wireframe cube rendered in the terminal using ncurses.
Vertices are projected onto the screen with perspective projection and
connected by edges drawn with Bresenham's line algorithm.
The cube spins continuously and can be quit with q.
Requires clang and ncurses.
make # release build
make debug # debug build with AddressSanitizer and UBSan
make run # build (debug) and run
make clean # remove build artefacts./bin/cube # or make runPress q to quit.
src/
main.c entry point and render loop
cube.c/h cube state, projection, rotation, and drawing
ncdraw.c/h ncurses drawing primitives (pixel, line)
debug.h assertion macros (active only with -DDEBUG)