Skip to content

Description of the vox file format #1891

@mentiflectax

Description

@mentiflectax

Is there any detailed description of the VOX file format, apart from the MagicalVoxel page?

Do the links below refer to the VOX format used in MagicalVoxel?

On the homepage of Ken Silverman I found the following description of the file format.

What's the .VOX file format?

Both SLABSPRI & SLAB6 support a simpler, uncompressed voxel format using the .VOX file extension. (See the documentation that comes with those programs.) The .VOX format is simple enough to fit a description of it right here. Here's some C pseudocode:

long xsiz, ysiz, zsiz; //Variable declarations
char voxel[xsiz][ysiz][zsiz];
char palette[256][3];

fil = open("?.vox",...);
read(fil,&xsiz,4); //Dimensions of 3-D array of voxels
read(fil,&ysiz,4);
read(fil,&zsiz,4);
read(fil,voxel,xsiz_ysiz_zsiz); //The 3-D array itself!
read(fil,palette,768); //VGA palette (values range from 0-63)
close(fil);
In the voxel array, use color 255 to define your empty space (air). For interior voxels (ones you can never see), do not use color 255, because it will prevent SLABSPRI from being able to take advantage of back-face culling.

Is it correct? Is the VOX file format described here the same as the one used by MagicalVoxel/AFrame?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions