Tutorials/Programs and editors/Binvox

Binvox is a command-line program that turns 3D files into .binvox building plan files or into .schematic files for import using MCEdit. A .binvox output file can then be viewed by the interactive "viewvox" OpenGL program, provided by the same author. The main page for these programs is on Patrick Min's site.

The process of converting a set of 3D polygons to their equivalents in blocks is called "voxelization". Binvox voxelizes, viewvox shows the results. Voxelization is not a perfect process, in the sense that there are decisions to be made. Other than the output resolution, the most important decisions revolve around how much coverage of a voxel by a model for that voxel to be considered "filled" by the model. For this reason, there are many ways to control binvox's results.

Supported Systems
Binvox and viewvox run under Windows, Mac, and Linux systems. The viewvox viewing program uses OpenGL and GLUT.

Download
For Windows, download vox_package.zip and unzip to a directory. This distribution also includes two sample 3D files and .BAT files to voxelize them. See the README.txt in that distribution.

For other platforms, the binvox and viewvox programs and GLUT library must each be downloaded separately.

File Formats
The following 3D file formats can be read in: Wavefront OBJ, VRML 2.0, UG, OFF, DXF, XGL, POV, BREP, PLY, JOT. Only polygons are supported for most of these (VRML 2.0 is almost fully supported). In reality, Wavefront OBJ is probably best supported.

Models can be created or found on the web, e.g. at the Turbosquid website (tip: sort by cost). To convert from 3DS to OBJ, programs such as MeshLab can be used.

For output, the .binvox file format (the default) is viewable with the viewvox program. Simply type "viewvox .binvox" to run the viewer. A .schematic file can be output instead by using "-t schematic" when running binvox. Along with the "-bi " option, to specify what type of blocks are generated, the .schematic files generated can be imported into worlds by using MCEdit.

Gallery
A photo gallery of creations is maintained by the program's author. If you make anything, send him (address here) photos of your hand-made creations and he'll probably add them.

Tutorial
Here is the general tutorial, scroll down to about the tenth post. There is also a Mac-centric tutorial.

Binvox commands
Current options for binvox (find by running "binvox" without any arguments):

Usage: binvox [-d ] [-t ] [-c] [-v] -d: specify voxel grid size (default 256, max 1024) -t: specify voxel file type (default binvox, also supported: hips, mira, vtk, raw, schematic) -c: z-buffer based carving method only -dc: dilated carving, stop carving 1 voxel before intersection -v: z-buffer based parity voting method only (default is both -c and -v) -e: exact voxelization (any voxel with part of a triangle gets set)(does not use graphics card) Additional parameters: -bb     : force a different input model bounding box -ri: remove internal voxels -cb: center model inside unit cube -rotx: rotate object 90 degrees ccw around x-axis before voxelizing -rotz: rotate object 90 degrees ccw around z-axis before voxelizing both -rotx and -rotz can be used multiple times -aw: _also_ render the model in wireframe (helps with thin parts) -fit: only write the voxels in the voxel bounding box -bi : when converting to schematic, use block ID  -down: downsample voxels by a factor of 2 in each dimension (can be used multiple times) -dmin : when downsampling, destination voxel is on if >=  source voxels are (default 4) Supported 3D model file formats: VRML V2.0: almost fully supported UG, OBJ, OFF, DXF, XGL, POV, BREP, PLY, JOT: only polygons supported Example: binvox -c -d 200 -t mira plane.wrl

Viewvox controls
Tip: to see an plan view of the model's levels for building, type "pannntsy" (3 n's) when viewvox starts up. "j" and "k" then move through the horizontal levels of the model, and the underlying level's blocks are shown in semi-transparent gray and white.

Current controls for viewvox:

Mouse left button = rotate middle     = pan right      = zoom Key r          = reset view arrow keys = move 1 voxel step along x (left, right) or y (up, down) =,-        = move 1 voxel step along z

q          = quit

a          = toggle alternating colours p          = toggle between orthographic and perspective projection x, y, z    = set camera looking down X, Y, or Z axis X, Y, Z    = set camera looking up X, Y, or Z axis 1          = toggle show x, y, and z coordinates

s          = show single slice n          = show both/above/below slice neighbour(s) t          = toggle neighbour transparency j          = move slice down k          = move slice up      g           = toggle show grid at slice level