game4all / bevy_vox_mesh Goto Github PK
View Code? Open in Web Editor NEWA bevy engine plugin for loading magica voxel files directly in bevy as usable meshes.
License: MIT License
A bevy engine plugin for loading magica voxel files directly in bevy as usable meshes.
License: MIT License
It would be great to add an example load .vox with multiple objects.
Maybe it will be useful for someone:
The firsts mesh: asset_server.load("path/to/vox/name.vox"),
The second mesh: asset_server.load("path/to/vox/name.vox#model1"),
The third mesh: asset_server.load("path/to/vox/name.vox#model2"),
If you compare how an asymmetrical model appears in MV with Bevy, when loading via bevy_vox_mesh, the model is flipped on the x axis.
eg: the monu1 model that ships with MagicaVoxel as viewed in MV:
Same model in bevy:
I believe the fix for this is to change the linearisation in voxel.rs lines 35-37 to:
let index =
model_shape.linearize([model.size.x - voxel.x as u32, voxel.z as u32 + 1, voxel.y as u32 + 1])
as usize;
this seems like the right place to flip the x axis, as this is where the Y and Z axes get swapped
In the "basic" example, if you spawn a cube at the same location as a .vox model, it appears that the .vox model is imported within a larger shape, but is positioned at one of the corners of the invisible shape. If you rotate the transform of the .vox mesh, it rotates around the center point of the invisible shape.
So that i can publish the rewrite (a788efb) along with the upgrade to bevy 0.6
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.