This repository contains code that adds 3D capabilities on top of browser-based SVGs. It builds on top of SVG.js.
See an example animation here, and its source code here. That page shows things like this, animated:
This is in a pre-alpha state. It is a prototype/experiment only, and if it were to move forward, it would need to be documented, tested, enhanced, plus a build system introduced, etc.
Some enhancements I'd like to make include these.
- Create a
Mesh
class that is a collection ofPolygon
s. - Extend the
Mesh
class with subdivision algorithms, including crease and sharpness parameters. (This is especially important because right now the occlusion algorithm is only sometimes correct, due to SVG limitations. One could make it better by taking large polygons and subdividing them into many little ones.) - Add classes for common shapes, such as:
- Parametric surfaces
- Spheres
- Cylinders
- Rectangular solids