-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from andstor/develop
v1.0.0
- Loading branch information
Showing
13 changed files
with
8,458 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"presets": ["@babel/preset-env"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.yml] | ||
indent_style = space | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,78 @@ | ||
# three-voxel-loader | ||
# three-voxel-loader | ||
|
||
> [three.js](https://github.com/mrdoob/three.js) plugin for loading voxel data | ||
[![npm version](http://img.shields.io/npm/v/three-voxel-loader.svg?style=flat)](https://npmjs.org/package/three-voxel-loader "View this project on npm") | ||
[![Build Status](https://travis-ci.org/andstor/three-voxel-loader.svg?branch=master)](https://travis-ci.org/andstor/three-voxel-loader) | ||
[![Coverage Status](https://coveralls.io/repos/github/andstor/three-voxel-loader/badge.svg?branch=master)](https://coveralls.io/github/andstor/three-voxel-loader?branch=master) | ||
[![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/andstorh/three-voxel-loader.svg?)](https://lgtm.com/projects/g/andstorh/three-voxel-loader/context:javascript) | ||
|
||
[Documentation](https://andstor.github.io/three-voxel-loader/) - [Wiki](https://github.com/andstor/three-voxel-loader/wiki) | ||
|
||
## Table of Contents | ||
* [Installation](#installation) | ||
* [Usage](#usage) | ||
* [Import support](#import-support) | ||
* [License](#license) | ||
|
||
## Installation | ||
This library requires the peer dependency [three.js](https://github.com/mrdoob/three.js/). | ||
|
||
```sh | ||
$ npm install --save three | ||
``` | ||
|
||
```sh | ||
$ npm install --save three-voxel-loader | ||
``` | ||
|
||
## Usage | ||
|
||
### Syntax | ||
```js | ||
new VoxelLoader() | ||
``` | ||
|
||
### Example | ||
```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/monster.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' ); | ||
} | ||
); | ||
``` | ||
|
||
## Import support | ||
Importing of several file types and data structures with voxel data are supported. | ||
|
||
### File formats | ||
- VOX | ||
- XML | ||
|
||
### Data structures | ||
- 3D array | ||
- [Sparse octree](https://github.com/vanruesc/sparse-octree) | ||
|
||
## License | ||
three-voxel-loader is licensed under the [MIT License](https://github.com/andstor/three-voxel-loader/blob/master/LICENSE). | ||
Copyright © [André Storhaug](https://github.com/andstor) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = require('../src/VoxelLoader').default; |
Oops, something went wrong.