Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mikolalysenko/rle-voxeljs
Convert rle volumes to voxel.js
https://github.com/mikolalysenko/rle-voxeljs
Last synced: 2 months ago
JSON representation
Convert rle volumes to voxel.js
- Host: GitHub
- URL: https://github.com/mikolalysenko/rle-voxeljs
- Owner: mikolalysenko
- Created: 2013-02-10T21:38:08.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2013-03-23T13:43:51.000Z (almost 12 years ago)
- Last Synced: 2024-10-10T11:38:55.519Z (3 months ago)
- Language: JavaScript
- Size: 123 KB
- Stars: 3
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
rle-voxeljs
===========
Convert rle volumes to voxel.jsUsage/Installation
==================
First, install using npm:npm install rle-voxel
Then, you can just convert a volume using module.exports:```javascript
var bunny_rle = require("rle-rasterize")(require(bunny));
require("rle-voxeljs")(voxels, bunny_rle, [[-20, -20, -20], [20, 20, 20]]);
```If you just want to initialize your game with a narrowband level set, then it may be more direct to just wrap the classifyPoint function as a generator:
```javascript
var testPoint = require("rle-classify").point.bind(null, bunny_rle);
var generator = function(x,y,z) { return testPoint([x,y,z]); };
```The main method is the following:
`require("rle-voxeljs")(voxels, rle, bounds, start_pos)`
---------------------------------------------
The arguments to the function are as follows:* `voxels`: The voxeljs game object
* `rle`: A narrowband level set
* `bounds`: The bounds of the object to convert
* `start_pos`: A translation offsetCredits
=======
(c) 2013 Mikola Lysenko. BSD