Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/valen-h/3d
A 3D framework with 2D projection for ES5+
https://github.com/valen-h/3d
2d 3d canvas graphics js no-webgl web
Last synced: 14 days ago
JSON representation
A 3D framework with 2D projection for ES5+
- Host: GitHub
- URL: https://github.com/valen-h/3d
- Owner: Valen-H
- License: gpl-3.0
- Created: 2018-11-03T07:49:19.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-03-12T15:29:58.000Z (almost 5 years ago)
- Last Synced: 2024-11-06T10:12:31.214Z (2 months ago)
- Topics: 2d, 3d, canvas, graphics, js, no-webgl, web
- Language: JavaScript
- Homepage: https://valen-h.github.io/3D/3D.html
- Size: 85 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 3D
A 3D framework with 2D projection for ES5+. Sample: https://valen-h.github.io/3D/3D.html
**Sick and tired of your old mobile not being able to use WebGL? ... No More!**
## Usage
```javascript
var map = new D3Map(500); /* the only parameter is the distance of the camera from the center of the plane (Z-pivot) */
map.add(50, 50, 50); /* add a new 3d point to the map, returns a D3Vertex */
/**
* The D3Vertex object contains the ed projected coordinates of the point as vtex.coords and the 2d projection as vtex.coord2d.
* The D3Map object contains the methods `map.translate(x, y, z)` and `map.rotate(x, y, z)` for controling the camera and others like `segmentConnect(vertices, context2d)` for line carving.
* There's also a hidden D3Cube struct for convenience and D3Vertex operations such as `dot(vertex)` or `clip(relativeVertex)`...
* Thats it! you can start making your own structures out of those points! read the `.js` files for more documentation...
*/
```