sandrofigo / VoxReader

A C# library to read .vox files created with MagicaVoxel
MIT License
62 stars 3 forks source link

Add support to get model positions #7

Closed rbxrootx closed 1 year ago

rbxrootx commented 1 year ago

I'm working with .vox files, and I noticed there isn't a way to get the position of a group, the cars.vox file included with magicavoxel, has two groups which can be seen below, however when I parse the voxels using voxelReader and since there's no group positions, the voxels all occupy the same space.

image ,

sandrofigo commented 1 year ago

I'm going to add this feature with the next release and will post any updates here.

rbxrootx commented 1 year ago

Great thank you so much!

sandrofigo commented 1 year ago

@rbxrootx This feature is now included in the v3.0.0 release. Let me know if you encounter any bugs.

sandrofigo commented 1 year ago

@rbxrootx The voxel position has not changed, but you are now able to add the Position property from the Model to get the global voxel position. Please note that the model position in MagicaVoxel is located at the center of each model, you might have to take the model size into account for the correct position.

I will probably add a helper function in a future version soon™️

sandrofigo commented 1 year ago

With #13 all voxels have a new global position property.