Skip to content

FelipePassarela/3d-engine-on-terminal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

3D Engine on Terminal

Python Version from PEP 621 TOML

A minimalistic 3D engine that renders models in the terminal using unicode characters. No external graphics libraries are used. The entire 3D rendering pipeline is implemented from scratch, using only basic Python and NumPy for matrix operations.

Features

  • 3D Model Loading: Supports loading 3D models from OBJ files.
  • Transformations: Implements basic transformations: translation, rotation, and scaling.
  • Shading: Simple shading based on the angle of the surface to a light source.
  • Terminal Rendering: Renders the final output in the terminal using unicode characters.
  • Performance: Optimized for real-time rendering in the terminal, achieving smooth animations.
  • Interactive Controls: Allows user interaction to move the camera and rotate the model.

Usage

Important

Before running the engine, resize the terminal window to a resolution of 120x40 characters for proper display. You can do this through terminal settings or, alternatively, simply run the engine and drag the window until the image is displayed correctly.

Install the package and run the main script:

pip install .
graphicspipe
# uv sync
# uv run graphicspipe

Controls

  • W/A/S/D: Move the camera.
  • ↑/←/↓/→/: Rotate the camera.
  • R: Rotate the model.
  • +/-: Adjust FOV.
  • Esc: Exit the engine.

Project Demo

Click the image below to watch a demo of the engine in action:

Watch Demo

About

A minimalistic 3D engine that renders models in the terminal using unicode characters. No external graphics libraries are used.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages