Giter Site home page Giter Site logo

atmega328-tiny-3d-engine's Introduction

ATmega328 Tiny 3D Engine (Arduino UNO)

3D model viewer made for the ATmega328 and Sainsmart 1.8" TFT screen (ST7735)

This is a tiny 3D engine made for the ATMEGA328 and a Sainsmart 1.8" TFT screen (ST7735). It uses the amazingly fast Adafruit GFX library fork by XarkLabs: github.com/XarkLabs

You can use the python script stl2h.py to convert STL models into header files and automatically import your meshes, just include the file and comment other mesh headers.

See stl2h.py help (./stl2h -h) for usage description.

Usage: ./stl2h.py -i <inputfile> -o <outputfile>
Convert a 3D mesh saved as STL format (ASCII) to header for Tiny 3D Engine.

  -i, --inputfile       3D mesh in STL file format
  -o, --outputfile      output filename of converted data
  -s, --scale           scale ratio (default 1.0)
  -n, --normals         save face normals
  -y, --yes             answer yes to all requests
  -v, --verbose         verbose output

Developed and tested with an Arduino UNO and a Sainsmart 1.8" TFT screen.

Features:

  • matrices for mesh transformations
  • fixed point to avoid using floats
  • 90 degrees fixed point look up table for sin/cos
  • backface culling using shoelace algorithm
  • flat colors (-unfinished/experimental/not fast enough-)
  • rotate the mesh with a 3 axis accelerometer (ADXL335)
  • rotate the mesh with a joystick thumb
  • push button on digital PIN 2 to change the render type.

This is a project for the ATmega328 and ST7735, source will certainly need some tweaking to run on other components.

Not implemented:

  • clipping
  • view/projection matrices (projection is done on world matrix directly)
  • hidden surface removal

Dependencies:

Video:

Preview of Tiny 3D Engine on YouTube

Screenshot:

Screenshot

References:

Wiring

Game Loop

Peter Collingridge 3D graphics tutorial

J-Snake Fixed Point Arithmetic

Math Open References

World, View and Projection Transformation Matrices

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.