@sh-dave/format-vox

0.1.6 • Public • Published

haxe-format-vox

A reader for MagicaVoxels's VOX files. Reads most of the v0.99 chunks including the world builder nodes.

  • [x] PACK - skipped / unused
  • [x] SIZE
  • [x] XYZI
  • [x] RGBA
  • [x] MATT - skipped / unused
  • [X] MATL
  • [x] nTRN
  • [x] nSHP
  • [x] nGRP
  • [ ] rOBJ - missing specs
  • [ ] LAYR - missing specs

haxe

usage in haxe

var data: BytesData = ...;
format.vox.VoxReader.read(data, function( ?vox, ?err ) {
	if (err != null) {
		trace(err);
		return;
	}

	// use vox.models to get the meshes
	// use vox.nodeGraph to access to world builder nodes
});

haxe examples

javascript

usage in javascript

const VoxReader = require('@sh-dave/format-vox').VoxReader;
const data = ...some ArrayBuffer...;

VoxReader.read(data, (vox, err) => {
	if (err) {
		console.error(err);
		return;
	}

	// use vox.models to get the meshes
	// use vox.nodeGraph to access to world builder nodes
});

javascript library build instructions

All dependencies are simply installed via npm thanks to lix

npm install
npx haxe build-js.hxml

Readme

Keywords

Package Sidebar

Install

npm i @sh-dave/format-vox

Weekly Downloads

37

Version

0.1.6

License

zlib

Unpacked Size

44.2 kB

Total Files

21

Last publish

Collaborators

  • sh-dave