Reputation: 2469
To be able to do biome transitions in procedural generation, I need to know when chosen coordinates (x, y, z)
are within a distance d
of an other cell.
I can make a simple 3D voronoï by placing cell cores in a volume and then for each given (x, y, z)
coordinates, look for the closest cell core but this method does not work to get the distance d
to the cell's membrane as I need to know witch are the neighbour cells.
Is there a simple way to know if two cells are neighbours or should I rather use a different way ? ( and in the second case, how should I proceed ? )
Upvotes: 0
Views: 68
Reputation: 946
Two voronoi regions touch if and only if their sites are adjacent in the corresponding Delaunay triangulation (a graph of one is the dual of the other).
Many implementations calculate both Delaunay triangulation results & the voronoi data - if you're not writing your own solver, I'd look for a library that gives info for both structures. A note of caution: you may need to check for certain edge cases; some implementations may have edges that meet at infinity in unbounded diagrams for instance.
Upvotes: 2