vengi-voxel / vengi

free and open source voxel art tools - editor, thumbnailer and format converter
http://vengi-voxel.github.io/vengi/
Other
1.05k stars 87 forks source link

VOXELFORMAT: add m3d support #328

Closed bztsrc closed 9 months ago

bztsrc commented 9 months ago

Hi,

I've seen #50 that you're planning to add M3D to vengi. That would be great!

Basically you have two options:

  1. use the official M3D SDK (stb-style single header library)
    
    #define M3D_IMPLEMENTATION
    #define M3D_NOVOXELS        // this is needed to avoid automatic tessellation of voxels into triangle mesh
    #define M3D_CPPWRAPPER      // to add C++ class
    #include <m3d.h>

model = new M3D::Model(&m3d_file_data, nullptr, nullptr, nullptr);


2. without the SDK, you can still implement it easily (as you already have stb_image.h which is needed for decompression). Here's a simplified specification, limited to [voxel models](https://gitlab.com/bztsrc/model3d/-/blob/master/docs/voxel_format.md) only, and you can find an independent, fully featured goxel importer / exporter [here](https://gitlab.com/bztsrc/model3d/-/tree/master/goxel) (it's a bit more advanced than the one you've linked from the goxel's issue, this one supports all index sizes, materials and all goxel meta info in goxel specific chunks too). The full file format documentation (with all the features) is [here](https://gitlab.com/bztsrc/model3d/-/blob/master/docs/m3d_format.md) if you're interested.

Let me know if you have any questions, I'd be glad to help!

Cheers,
bzt
mgerhardy commented 9 months ago

unfortunately the goxel code is released under the gpl.

is there some validator for the format that I could run my own implementation against?

Also I'll close this issue to continue in the already existing one.