All Projects → avem-labs → Ol3d

avem-labs / Ol3d

A tiny portable 3D graphics lib for micro controllers

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Ol3d

Blog
A set of various projects based on ESP8266, ESP32, ATtiny13, ATtiny85, ATtiny2313, ATmega8, ATmega328, ATmega32, STM32 and more.
Stars: ✭ 198 (+120%)
Mutual labels:  arduino, esp32, microcontroller
Platformio Atom Ide
PlatformIO IDE for Atom: The next generation integrated development environment for IoT
Stars: ✭ 475 (+427.78%)
Mutual labels:  arduino, esp32, microcontroller
Platformio Core
PlatformIO is a professional collaborative platform for embedded development 👽 A place where Developers and Teams have true Freedom! No more vendor lock-in!
Stars: ✭ 5,539 (+6054.44%)
Mutual labels:  arduino, esp32, microcontroller
Mysensors
MySensors library and examples
Stars: ✭ 1,150 (+1177.78%)
Mutual labels:  arduino, esp32
Deepsleepscheduler
DeepSleepScheduler is a lightweight, cooperative task scheduler library with configurable sleep and task supervision.
Stars: ✭ 59 (-34.44%)
Mutual labels:  arduino, esp32
Koduino
Arduino code for STM32 microcontrollers
Stars: ✭ 63 (-30%)
Mutual labels:  arduino, microcontroller
Ttgo T Wristband
First steps with TTGO T-Wristband
Stars: ✭ 50 (-44.44%)
Mutual labels:  arduino, esp32
Serial Studio
Multi-purpose serial data visualization & processing program
Stars: ✭ 1,168 (+1197.78%)
Mutual labels:  arduino, microcontroller
Blinker Library
An IoT Solution,Blinker library for embedded hardware. Works with Arduino, ESP8266, ESP32.
Stars: ✭ 1,095 (+1116.67%)
Mutual labels:  arduino, esp32
Espuino
RFID-controlled musicplayer powered by ESP32
Stars: ✭ 71 (-21.11%)
Mutual labels:  arduino, esp32
Tinygsm
A small Arduino library for GSM modules, that just works
Stars: ✭ 1,186 (+1217.78%)
Mutual labels:  arduino, esp32
Bleeper
Library to manage your firmware configurations written in C++
Stars: ✭ 54 (-40%)
Mutual labels:  arduino, esp32
Wifisatellite
WiFi Satellite Project - as seen on the Chaos Communication Congress
Stars: ✭ 52 (-42.22%)
Mutual labels:  arduino, esp32
3d Game Shaders For Beginners
🎮 A step-by-step guide to implementing SSAO, depth of field, lighting, normal mapping, and more for your 3D game.
Stars: ✭ 11,698 (+12897.78%)
Mutual labels:  graphics, 3d-graphics
Esp32modbustcp
Modbus client for ESP32
Stars: ✭ 51 (-43.33%)
Mutual labels:  arduino, esp32
Stickwatch
A DIY smart watch based on M5Stick of ESP32
Stars: ✭ 68 (-24.44%)
Mutual labels:  arduino, esp32
Aunit
Unit testing framework for Arduino platforms inspired by ArduinoUnit and Google Test. Used with AUniter or EpoxyDuino for continuous builds.
Stars: ✭ 73 (-18.89%)
Mutual labels:  arduino, esp32
Esp32 Chimera Core
ESP32-Chimera-Core 👾 is an arduino library for M5Stack, Odroid-Go, D-Duino-32-XS and other ESP32/TFT/SD bundles
Stars: ✭ 74 (-17.78%)
Mutual labels:  arduino, esp32
Flycube
Graphics API wrapper is written in C++ on top of Directx 12 and Vulkan. Provides main features including ray tracing.
Stars: ✭ 78 (-13.33%)
Mutual labels:  graphics, 3d-graphics
Tinygo
Go compiler for small places. Microcontrollers, WebAssembly (WASM/WASI), and command-line tools. Based on LLVM.
Stars: ✭ 9,068 (+9975.56%)
Mutual labels:  arduino, microcontroller

ol3d

A tiny portable 3D graphics lib for micro controllers.

49797676-c0ff-4ffa-8ffd-491a022d48d1

4c8069e8-ebb0-4954-86dc-0561095fcf95

Example

Render a low poly wolf

#include <SPI.h>
#include <ol3d_core.h>
#include <Wolf.h> // .obj data

void OLED_init();
void OLED_fill(unsigned char *buf);

// Declare display buffer, see ol3d_render.h
uint8_t buffer[128*128*3] = {};

float roll, yaw;

void setup () {
    SPI.begin();
    SPI.setClockDivider(SPI_CLOCK_DIV2);
    OLED_init(); // initialize your screen
    yaw = 0;
}

void loop () {

// MVP matrix
    ol3d_matrix_t p;
    ol3d_matrix_setPerspective(p, 60, 1, 1, 1000);
    ol3d_matrix_t v;
    ol3d_matrix_setTranslate(v, 0, 0, -700);
    ol3d_matrix_t vp;
    ol3d_matrix_multiply(v, p, vp);
    ol3d_matrix_t mvp;

// Render process
    for(;;) {
        // Model matrix of current frame
        ol3d_matrix_t m = MATRIX_UNIT;
        ol3d_matrix_translate(m, 0, -80, 0);    // Translate to center
        ol3d_matrix_rotate(m, (float)yaw, M_AXIS_Y);    // Rotate
        yaw += 8;

        ol3d_matrix_multiply(m, vp, mvp);

        ol3d_clean_buffer(buffer);
        ol3d_draw_Element(buffer, mesh_f, mesh_v, mesh_v, 100, mvp);
        OLED_fill(buffer);
    }
}

OBJ model headerfile style

Simply modify an obj file

double mesh_v[] = {
    -0.500000, -0.500000, 0.500000,
    0.500000, -0.500000, 0.500000,
    -0.500000, 0.500000, 0.500000,
    0.500000, 0.500000, 0.500000,
    -0.500000, 0.500000, -0.500000,
    0.500000, 0.500000, -0.500000,
    -0.500000, -0.500000, -0.500000,
    0.500000, -0.500000, -0.500000,
    -0.500000, -0.500000, 0.500000,
    0.500000, -0.500000, 0.500000,
    -0.500000, 0.500000, 0.500000,
    0.500000, 0.500000, 0.500000,
    -0.500000, 0.500000, -0.500000,
    0.500000, 0.500000, -0.500000,
    -0.500000, -0.500000, -0.500000,
    0.500000, -0.500000, -0.500000
};
long mesh_f[] = {
    1, 2, 3,
    3, 2, 4,
    3, 4, 5,
    5, 4, 6,
    5, 6, 7,
    7, 6, 8,
    7, 8, 1,
    1, 8, 2,
    2, 8, 4,
    4, 8, 6,
    7, 1, 5,
    5, 1, 3,
    9, 10, 11,
    11, 10, 12,
    11, 12, 13,
    13, 12, 14,
    13, 14, 15,
    15, 14, 16,
    15, 16, 9,
    9, 16, 10,
    10, 16, 12,
    12, 16, 14,
    15, 9, 13,
    13, 9, 11
};
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].