@voxolith/renderer/vox
A minimal MagicaVoxel .vox reader and writer, with no GPU or DOM dependency.
The format is a RIFF-like tree of chunks:
"VOX " <version:i32>
chunk := <id:4 bytes> <contentSize:i32> <childrenSize:i32> <content> <children>The root MAIN chunk holds everything else as children.
parseVox reads the first model only (SIZE + XYZI) plus the optional RGBA
palette; parseVoxScene reads the extended format (every model, the scene
graph, materials, layers and keyframes). Voxel colour indices are 1-based:
XYZI index c is palette entry c (file RGBA entry i maps to palette index
i + 1). Models are Z-up, as MagicaVoxel stores them; the renderer's grid is
Y-up, so callers swap axes when they build one.
Reference: https://github.com/ephtracy/voxel-model/blob/master/MagicaVoxel-file-format-vox.txt