ndarray-to-vox

0.1.0 • Public • Published

ndarray-to-vox

Convert a 3D ndarray to a vox file (Magica Voxel format)

Example

 
var ndarrayToVox = require('ndarray-to-vox');
 
// ...
 
var voxFile = ndarrayToVox(data); // returns a valid vox file as an ArrayBuffer instance

With a custom palette :

 
var ndarrayToVox = require('ndarray-to-vox');
 
var palette = [
    [255, 0, 0],
    [0, 255, 0],
    [0, 0, 255],
    [255, 255, 255],
];
 
// ...
 
var voxFile = ndarrayToVox(data, palette); // returns a valid vox file as an ArrayBuffer instance

History

0.1.0 (2015.11.30)

  • Add palette support.
  • Fix issue with color index being based on 0, where it should be based on 1.

0.0.1 (2015.11.27)

  • First implementation.

License

MIT

Package Sidebar

Install

npm i ndarray-to-vox

Weekly Downloads

1

Version

0.1.0

License

MIT

Last publish

Collaborators

  • kchapelier