Giter Club home page Giter Club logo

magicavoxelunity's Introduction

Note

This project is somewhat old and doesn't support parsing the new features added in the newer .vox format. Though it should still be able to load it. Due to constraints from my current employer, sadly I cannot directly work on this for now. I'll be glad to merge PRs : )

MagicaVoxelUnity

Unity3D plugin for MagicaVoxel's "vox" format

Features

  • Import "vox" files as meshes (faces combined if possible)
  • Import "vox" files as individual voxels (GameObjects)
    • Voxels can be combined into a single GameObject, so you can cut the voxel model into several GameObjects (meshes) for animation purposes

How To

  • Use Tools/MagicaVoxel/Load on the menubar to load and create a GameObject with a voxel model directly

  • Add MVVoxelModel script to your component

    • Use editor controls to load "vox" files onto the object

    • Or use MVVoxelModel's member methods

        LoadVOXFile(filePath, importAsIndividualVoxels)
        LoadVOXData(data, importAsIndividualVoxels)
      
        MVVoxelModel.sizePerVoxel, MVVoxelModel.voxMaterial and MVVoxelModel.meshOrigin can be configured before loading the file/data
      
  • When imported as separate voxels, selecting multiple voxels in the editor will give you a control to combine the selected voxels into a single mesh

    • The mesh can be divided into separate voxels again
  • Use static methods in MVImporter

      Load main chunk:
    
      	LoadVOX(file)
      	LoadVOXFromData(data)
    
      Create meshes from main chunk:
    
      	CreateMeshes(mainChunk, sizePerVox)
    
      Or create meshes and GameObjects from main chunk:
    
      	CreateVoxelGameObjects(mainChunk, parentTransform, material, sizePerVox)
      	CreateIndividualVoxelGameObjects(mainChunk, parentTransform, material, sizePerVox)
    

Todo

  • T-junction problems (intersections)
  • Optional disable face combining

License

MIT

Contact

Thanks

And all other contributors

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.