Giter Site home page Giter Site logo

3dsvgengine's Introduction

3D SVG Engine

Inspired by the OneLoneCoder_oclEngine3D.

What is this?

Just a hobby project to learn what goes into a 3D rendering engine. Most of the code was written while following along with this video series but rewriting it to be a javascript project instead of C++.

No 3rd party libraries are used in this project. All rendering is done using standard SVG drawing routines, so rendering can be very slow but very good at scale. Because SVG defines shapes instead of pixels, the same scene will take the same time to render at 10x10 as it will at 1920x1080.

img

Wireframe rendering is quite a bit slower due to the need to draw each line of every triangle, thus turning one polygon into three lines. There may be a way to check if a line exists before drawing a new one, but the current version does not make any attempt at that kind of optimization.

img

Running

As long as index.html and Library.js are in the same directory, there is no setup required. You can download this project and unzip it to your desktop and just double-click index.html to open it in a browser and it will run.

Controls

Key Action
Up Arrow Move camera up
Down Arrow Move camera down
Left Arrow Move camera left
Right Arrow Move camera right
W Key Move camera forward
S Key Move camera backward
A Key Pan camera left
D Key Pan camera right

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.