1.0.1 • Published 10 years ago
@vaalentin/geo-plane v1.0.1
@vaalentin/geo-plane
Plane geometry, extracted from three.js
Installation
$ npm install --save @vaalentin/geo-planeUsage
import getPlaneGeometry from '@vaalentin/geo-plane';
const { verts, uvs, faces } = getPlaneGeometry(1, 1, 2, 2);
// create buffersAPI
geo = getPlaneGeometry(w, h, dx, dy)
Returns a new geometry with:
- vertsis an float32 array of coordinates (by group of 3).
- uvsis an float32 array of uvs (by group of 2).
- facesis an uint16/32 array of the faces.
and where:
- wis the width of the plane (default is 1).
- his the height of the plane (default is 1).
- dxis the number of divisions on the width (default is 1).
- dyis the number of divisions on the height (default is 1).
License
MIT, see LICENSE.md for more details.
Credits
Thanks to three.js for the code.