Skip to content

Commit

Permalink
Merge pull request #8 from andstor/develop
Browse files Browse the repository at this point in the history
v1.0.0
  • Loading branch information
andstor authored Feb 16, 2020
2 parents 3a59edc + ba1987a commit d8e9279
Show file tree
Hide file tree
Showing 13 changed files with 8,458 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["@babel/preset-env"]
}
13 changes: 13 additions & 0 deletions .editorconfig
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
79 changes: 78 additions & 1 deletion README.md
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)
1 change: 1 addition & 0 deletions build/merge.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../src/VoxelLoader').default;
Loading

0 comments on commit d8e9279

Please sign in to comment.