3D-SCII demo

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.

Features

  • 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

Usage

The program will load and display the 3D model specified in the configuration. The point light source auto-rotates to demonstrate 3D rendering. Press Ctrl+C to exit.

Configuration

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 factor

Display settings can be configured in setting.h:

#define WIDTH 200                 // Terminal width
#define HEIGHT 100                // Terminal height

Built With

  • C — renderer and terminal I/O
  • CMake — build system
  • ANSI escape codes — color output