Spliting objects made from voxels, stored in 3D array.

Started by
0 comments, last by Waterlimon 9 years, 2 months ago

Hello I am looking for solution to split object made from voxels in two parts if they are separated by destruction. For example I have one big object but I destroy something and object should split in to two.

I store data in 3D array, where 1 mean voxel, 0 mean nothing, so I need to 0 as break indicator.

Anyone have any ideas how to solve that?

Advertisement
Flood fill in all directions from the split point.

Give each 'Flood' an ID and if two floods touch record that.

Then you end up with 0-6 distinct flooded areas to separate. (if two floods were recorded to touch treat them as one)

o3o

This topic is closed to new replies.

Advertisement