Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jakubtomsu/odin-vox

Odin loader for vox models from MagicaVoxel
https://github.com/jakubtomsu/odin-vox

Last synced: 18 days ago
JSON representation

Odin loader for vox models from MagicaVoxel

Awesome Lists containing this project

README

        

# :package: odin-vox
A simple loader for `.vox` models from [MagicaVoxel](https://ephtracy.github.io/).

The [base format](https://github.com/ephtracy/voxel-model/blob/master/MagicaVoxel-file-format-vox.txt) is fully implemented.

Supported extensions:
- Materials (including legacy MATT materials)

Latest tested odin version: `dev-2023-12-nightly:31b1aef4`

## Usage
```odin
// Load and parse data from file.
// Alternatively use `vox.load_from_data`.
if data, ok := vox.load_from_file("my_model.vox", context.temp_allocator); ok {
for model, i in data.models {
fmt.printf("Model %i:\n", i)
fmt.printf("\tsize: %v\n", model.size)
fmt.printf("\tvoxels:\n")
for voxel, j in model.voxels {
fmt.printf("\t[%i] %v: %i\n", j, voxel.pos, voxel.color_index)
}
}
}
```

## TODO
- Implement more [extensions](https://github.com/ephtracy/voxel-model/blob/master/MagicaVoxel-file-format-vox-extension.txt) as necessary

## Contributing
All contributions are welcome!