Socket
Socket
Sign inDemoInstall

vox-to-gltf

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vox-to-gltf

converts [.vox](https://github.com/ephtracy/voxel-model/blob/master/MagicaVoxel-file-format-vox.txt) files which can be exported in [MagickaVoxel](https://ephtracy.github.io/) to [.gltf](https://github.com/KhronosGroup/glTF/tree/master/specification/2.0


Version published
Maintainers
1
Created
Source

vox-to-gltf.js

converts .vox files which can be exported in MagickaVoxel to .gltf files. It is using three.js, vox-reader.js and voxel-triangulation.js.

💾 Installation

npm install --save vox-to-gltf

🚀 Usage

To include it in your project while using a bundling system like webpack use

const voxToGLTF = require('vox-to-gltf');

otherwise use

const voxToGLTF = require('vox-to-gltf/dist/vox-to-gltf.min.js');

To read a .vox file and make a .gltf file out of it you can do something like this

const fs = require('fs');
const voxToGLTF = require('vox-to-gltf');

fs.readFile('my-voxel-art.vox', (error, buffer) =>
{
 if(error) throw error;

 let gltfData = voxToGLTF(buffer);
 
 fs.writeFile('my-voxel-art.gltf', gltfData, (error) => 
 {
   if(error) throw err;
   
   console.log('The file has been saved!');
 });
});

📖 License

(c) 2019 Florian Fechner. MIT License

Keywords

FAQs

Package last updated on 15 Oct 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc