All Projects → kevzettler → parse-magica-voxel

kevzettler / parse-magica-voxel

Licence: GPL-3.0 license
Parse MagicaVoxel .vox files to javascript objects works in browser or server

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to parse-magica-voxel

VoxToVFX
Import a MagicaVoxel project to Unity using the new VFX Graph
Stars: ✭ 61 (+17.31%)
Mutual labels:  voxel, magicavoxel
voxel-editor
N-Space: a mobile app for building 3D interactive worlds
Stars: ✭ 39 (-25%)
Mutual labels:  voxel, voxels
MagicaVoxel File Writer
MagicaVoxel File Writer dependency free cpp class
Stars: ✭ 26 (-50%)
Mutual labels:  voxel, magicavoxel
Sucle
Common Lisp Voxel Game Engine
Stars: ✭ 239 (+359.62%)
Mutual labels:  voxel, voxels
voxel-builder
Voxel-based 3D modeling application
Stars: ✭ 31 (-40.38%)
Mutual labels:  voxel, magicavoxel
vengi
Home of a voxel game engine and its tools (like a voxel editor)
Stars: ✭ 800 (+1438.46%)
Mutual labels:  voxel, voxels
Cubizer
⚡️Create your voxel-style games in unity 2017
Stars: ✭ 79 (+51.92%)
Mutual labels:  voxel, voxels
Ue4voxelterrain
[WIP] Unreal Engine 4: Smooth voxel terrian example
Stars: ✭ 415 (+698.08%)
Mutual labels:  voxel, voxels
VoxMerger
Console program for merge multiple MagicaVoxel scenes (.vox)
Stars: ✭ 19 (-63.46%)
Mutual labels:  voxel, magicavoxel
Engine
Home of a voxel game engine and its tools (like a voxel editor)
Stars: ✭ 429 (+725%)
Mutual labels:  voxel, voxels
Voxel Core
Voxel plugin for the Godot game engine!
Stars: ✭ 148 (+184.62%)
Mutual labels:  voxel, voxels
Openvdb
OpenVDB - Sparse volume data structure and tools
Stars: ✭ 1,359 (+2513.46%)
Mutual labels:  voxel, voxels
Blood-Voxel-Pack
Additional voxel models for Blood video game. Compatible with BuildGDX, NBlood, and Fresh Supply.
Stars: ✭ 42 (-19.23%)
Mutual labels:  voxel, voxels
voxel-physics-engine
Simple but physical engine for voxels. Demo:
Stars: ✭ 59 (+13.46%)
Mutual labels:  voxel
Proceduralterrain
Procedural voxel terrain generation in Unity
Stars: ✭ 237 (+355.77%)
Mutual labels:  voxel
Cupoch
Robotics with GPU computing
Stars: ✭ 225 (+332.69%)
Mutual labels:  voxel
craftus reloaded
A second attempt at a homebrew Minecraft clone for 3DS
Stars: ✭ 44 (-15.38%)
Mutual labels:  voxel
ObjToSchematic
A tool to convert .obj files into Minecraft Schematics
Stars: ✭ 156 (+200%)
Mutual labels:  voxel
Pix2vox
Implementation of "Pix2Vox: Context-aware 3D Reconstruction from Single and Multi-view Images" (Xie et al., ICCV 2019)
Stars: ✭ 216 (+315.38%)
Mutual labels:  voxel
Marching Cubes On The Gpu
A implementation of the marching cubes algorithm on the GPU in Unity.
Stars: ✭ 208 (+300%)
Mutual labels:  voxel

Parse MagicaVoxel .vox file format

Javascript parser for MagicaVoxel .vox file format:

https://github.com/ephtracy/voxel-model/blob/master/MagicaVoxel-file-format-vox.txt

Works in Browser and Node.js server environments

Install

npm install parse-magica-voxel

Usage

see examples

  • Node.js
var fs = require('fs');
var parseMagicaVoxel = require('parse-magica-voxel');

fs.readFile("./chr_old.vox", function (err, Buffer) {
  if (err) throw err;
  console.log(JSON.stringify(parseMagicaVoxel(Buffer)));
});
  • Browser

You will have to bundle the module with Webpack or Browserify and load the voxel file using fetch or another XMLHttpRequest utility

var parseMagicaVoxel = require('parse-magica-voxel');
var myRequest = new Request('/example/path/to/your-vox-file.vox');
fetch(myRequest).then(function(response) {
    return response.arrayBuffer();
}).then(function(buffer) {
    console.log(JSON.stringify(parseMagicaVoxel(buffer));
});

Result

{
  "VOX ": 150,
  "PACK": 1,
  "SIZE": {
    "x": 20,
    "y": 21,
    "z": 20
  },
  "XYZI": [
   {x, y, z, c},
   //... more voxels
  ],
  "RGBA": [
   {r,g,b,a},
   //... more rgba values
  ],
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].