Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wanadev/gltf-bounding-box
Computes the global bounding box of a gltf model
https://github.com/wanadev/gltf-bounding-box
3d boundings gltf gltf2 model
Last synced: 3 months ago
JSON representation
Computes the global bounding box of a gltf model
- Host: GitHub
- URL: https://github.com/wanadev/gltf-bounding-box
- Owner: wanadev
- License: other
- Created: 2017-08-02T08:12:40.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-05-28T09:51:02.000Z (over 5 years ago)
- Last Synced: 2024-11-06T23:09:26.422Z (3 months ago)
- Topics: 3d, boundings, gltf, gltf2, model
- Language: JavaScript
- Size: 2.47 MB
- Stars: 20
- Watchers: 8
- Forks: 7
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gltf-bounding-box
Computes the global bounding box of a gltf model
[![npm version](http://img.shields.io/npm/v/gltf-bounding-box.svg)](https://www.npmjs.com/package/gltf-bounding-box)
[![Travis build status](http://img.shields.io/travis/wanadev/gltf-bounding-box.svg?style=flat)](https://travis-ci.org/wanadev/gltf-bounding-box)
[![Dependency Status](https://david-dm.org/wanadev/gltf-bounding-box.svg)](https://david-dm.org/wanadev/gltf-bounding-box)
[![devDependency Status](https://david-dm.org/wanadev/gltf-bounding-box/dev-status.svg)](https://david-dm.org/wanadev/gltf-bounding-box#info=devDependencies)## Usage
```javascript
import gltfBoundingBox from 'gltf-bounding-box';const model = JSON.parse(fs.readFileSync('suzanne.gltf'), 'utf8');
const boundings = gltfBoundingBox.computeBoundings(model);
// boundings:
{
dimensions: {
width: 3,
depth: 2,
height: 2,
},
center: {
x: 0,
y: 0,
z: 0,
},
}
```