Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/jakubtomsu/odin-vox
- Owner: jakubtomsu
- License: mit
- Created: 2023-10-29T21:17:10.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-14T07:52:28.000Z (almost 1 year ago)
- Last Synced: 2023-12-14T08:37:30.051Z (almost 1 year ago)
- Language: Odin
- Size: 11.7 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-odin - Vox loader - vox/blob/main/LICENSE) | Gamedev, Assets (Libraries / Formats)
- awesome-odin - Vox loader - vox/blob/main/LICENSE) | Gamedev, Assets (Libraries / Formats)
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!