Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Scrawk/Mesh-Voxelization
Mesh voxelization in Unity
https://github.com/Scrawk/Mesh-Voxelization
unity voxelization
Last synced: 3 months ago
JSON representation
Mesh voxelization in Unity
- Host: GitHub
- URL: https://github.com/Scrawk/Mesh-Voxelization
- Owner: Scrawk
- License: mit
- Created: 2017-06-21T03:36:17.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-01-05T13:24:50.000Z (almost 4 years ago)
- Last Synced: 2024-07-12T12:36:12.901Z (4 months ago)
- Topics: unity, voxelization
- Language: C#
- Size: 99.6 KB
- Stars: 227
- Watchers: 9
- Forks: 43
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-unity-open-source-on-github - Mesh-Voxelization - Mesh voxelization (Voxel)
README
# Mesh-Voxelization
This project converts a mesh into voxels in Unity. The idea is to ray trace the mesh and find where each ray intersects a triangle. These positions can then be used to make a 3D array of voxels.
The ray tracing is accelerated by using a AABB tree to group the mesh triangles. The AABB tree should be much faster for large meshes but the overhead might not be worth it for smaller meshes.
The original code for the AABB tree can be found in the core section of [this](https://github.com/mmacklin/sandbox) collection of code from Miles Macklins [blog](http://blog.mmacklin.com/).
For the demo scene the voxels are converted back into a mesh by adding quads at the edge of each voxel.
The mesh before voxelization.
![Before voxelization](./Media/BeforeVoxelization.jfif)
The mesh after voxelization.
![After voxelization](./Media/AfterVoxelization.jfif)