Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Description of the vox file format #1891

Closed
mentiflectax opened this issue Sep 4, 2016 · 1 comment
Closed

Description of the vox file format #1891

mentiflectax opened this issue Sep 4, 2016 · 1 comment

Comments

@mentiflectax
Copy link

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?

@ngokevin
Copy link
Member

ngokevin commented Sep 5, 2016

Not sure. A-Frame doesn't depend on .VOX though, and suggested exports from MagicaVoxel is OBJ (or at least PLY).

@ngokevin ngokevin closed this as completed Sep 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants