three.js plugin for loading voxel data
npm install three-voxel-loader> three.js plugin for loading voxel data

!Build


This is a plugin for three.js. It provides support for loading voxel data and turning it into a three.js Mesh.
Examples -
Documentation -
Wiki
* Preview
* Installation
* Usage
* Import support
* License

This library requires the peer dependency three.js.
``sh`
$ npm install --save three
`sh`
$ npm install --save three-voxel-loader
`js`
new VoxelLoader()
`js
const VoxelLoader = require('three-voxel-loader');
// Instantiate the loader
let loader = new VoxelLoader();
// Load a resource from provided URL.
loader.load(
// Resource URL.
'models/chicken.vox',
// Called when resource is loaded.
function ( voxels ) {
scene.add( voxels );
},
// Called when loading is in progresses.
function ( xhr ) {
console.log( ( xhr.loaded / xhr.total * 100 ) + '% loaded' );
},
// Called when loading has errors.
function ( error ) {
console.log( 'An error happened' );
}
);
``
Importing of several file types and data structures with voxel data are supported.
- 3D array
- Sparse octree
Copyright © 2020 André Storhaug
three-voxel-loader is licensed under the MIT License.