Description

vox-d is a library to load VOX voxel files (used by eg. MagicaVoxel).

Package Information

Version0.0.5 (2015-May-17)
Homepagehttp://github.com/p0nce/vox-d/
Repositoryhttps://github.com/p0nce/vox-d
Licensepublic domain
Authorsponce
Registered byponce
Dependenciesnone

Installation

To use this package, put the following dependency into your project's dependencies section:

dub.json
dub.sdl

Readme

What's this?

vox-d is a library to load several format of voxel bitmap files.

  • .VOX: Format used by MagicaVoxel, supports alpha
  • .VOX: Simple uncompressed grid of 8-bit values

Licenses

See UNLICENSE.txt

Usage


import std.stdio;
import voxd;

void main()
{
    VOX model = decodeVOX("dragon.vox");

    writefln("width = %s", model.width);
    writefln("height = %s", model.height);
    writefln("depth = %s", model.depth);
    writefln("That makes %s voxels total", model.numVoxels());

    VoxColor color = model.voxel(0, 1, 2);
    writefln("voxel (0, 1, 2) has color (r = %s, g = %s, b = %s, a = %s)", color.r, color.g, color.b, color.a);
}

Available versions

0.0.5 0.0.4 0.0.3 0.0.2 0.0.1 ~master