A software 3D renderer that displays models directly in the terminal using ANSI escape codes and ASCII characters. Written in C, this project implements a basic graphics pipeline including mesh loading, lighting, and rasterization using just the standard library.
- OBJ file loading and parsing
- Basic lighting system with ambient and point lights
- Wireframe and filled polygon rendering modes
- Z-buffer for proper depth handling
- Terminal-based display using ANSI colors
- Frame buffering for smooth animation
- Vector/matrix math operations for 3D transformations
This project uses CMake for building. To build:
mkdir build
cd build
cmake ..
makeRun the compiled executable:
./buildThe program will load and display the 3D model specified in FILENAME.
- The point light source auto-rotates to demonstrate 3D rendering
- Press Ctrl+C to exit
Edit the following defines in main.c to change the model and scaling:
#define FILENAME "Mask01.obj" // OBJ file to load
#define SCALING_FACTOR 0.0004f // Model scale factorDisplay settings can be configured in setting.h:
#define WIDTH 200 // Terminal width
#define HEIGHT 100 // Terminal height