A tiny portable 3D graphics lib for micro controllers (Oled display) logo

A tiny portable 3D graphics lib for micro controllers (Oled display)

Free

A tiny portable 3D graphics lib for micro controllers

FreeFree tier
Type
Open Source

About A tiny portable 3D graphics lib for micro controllers (Oled display)

ol3d is a lightweight, portable 3D graphics library designed for microcontrollers such as ESP32 and Arduino. It enables rendering of low-poly 3D models on small OLED displays using a simple MVP (Model-View-Projection) matrix pipeline. The library is written in C/C++ and includes modules for core operations, matrix math, rendering, and vector math. It accepts 3D model data in the form of vertex and face arrays (converted from OBJ files) and outputs a frame buffer that can be sent to an SPI-connected OLED screen. The example provided demonstrates rendering a rotating low-poly wolf model.

Key Features

Lightweight and portable C/C++ library for microcontrollers
Supports rendering 3D models from OBJ data converted to header arrays
Implements MVP (Model-View-Projection) matrix transformations
Works with OLED displays via SPI protocol
Includes separate modules for vector, matrix, core, and rendering operations
Designed for ESP32 and Arduino platforms

Pros & Cons

Pros
  • Extremely lightweight and suitable for memory-constrained microcontrollers
  • Open source with permissive license (MIT implied by GitHub) and active community
  • Simple API and straightforward integration with existing Arduino/ESP32 code
  • Supports common 3D operations like translation, rotation, and perspective projection
  • No external dependencies beyond standard SPI display libraries
Cons
  • Limited to low-resolution displays (e.g., 128x128) and simple polygon rendering
  • No built-in shading, lighting, or texture mapping capabilities
  • Requires manual conversion of OBJ files to C header arrays
  • Lacks comprehensive documentation beyond the example code
  • No Z-buffer; overlapping polygons may not be handled correctly

Best For

Rendering real-time 3D graphics on small OLED displays in embedded projectsCreating simple 3D visualizations for microcontroller-based devicesEducational exploration of 3D rendering on constrained hardware

FAQ

What microcontrollers are supported?
The library is primarily tested on ESP32 and Arduino platforms, as indicated by the repository topics and example code.
What type of display does it work with?
The example uses an OLED display connected via SPI, and the library writes to a buffer that can be sent to such displays.
Can I use OBJ models directly?
OBJ models need to be converted into C header arrays containing vertex and face data. The repository shows an example of this format.