vox-d 1.0.0

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


To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:

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 = decodeVOXFromFile("dragon.vox"); // alternatively: decodeVOXFromMemory(ubyte[] data)

    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);
}

Authors:
  • ponce
Dependencies:
none
Versions:
1.0.0 2021-Apr-30
0.0.5 2015-May-17
0.0.4 2015-May-17
0.0.3 2015-May-17
0.0.2 2014-Aug-03
Show all 7 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 0 downloads this month

  • 252 downloads total

Score:
0.9
Short URL:
vox-d.dub.pm