Voronoi Tessellations
datagenetics.com
datagenetics.com
Please don't do this. Folks put effort into well-illustrated explanations; if you're going to re-use content, at least put an attribution and link on there!
Speaking of attribution, why doesn't that article reference Lloyd's algorithm? https://en.m.wikipedia.org/wiki/Lloyd%27s_algorithm
Still, that's a good stand-alone link – I'll add it to the writeup.
[1] https://www.cs.ubc.ca/labs/imager/tr/2002/secord2002b/secord... [2] https://www.cs.princeton.edu/courses/archive/fall00/cs597b/p...
Nothing wrong with using the Wikipedia article as an informal reference, but wherever you reference the other papers, considering linking to Lloyd's IEEE paper directly.
Splitting the centroid computation into a two-pass accumulation is a great idea. Even though that makes for heavy shaders, I imagine it's still faster than doing a buffer read and finding the centroids in one pass via CPU?
I'd also be interested in hearing how you decide on convergence. Are you stoppping after a fixed number of iterations? Or are you able to track the offsets using the GPU - not sure if that is possible since you're writing back into the VBO directly? You probably know from playing with it that Lloyd's algorithm is notorious for very long convergence times. It gets close very quickly, and then can have a super long tail with many small iterations and then sudden large changes long after it seemed like things had settled. It's super fun to watch, especially when you dynamically add points, very reminiscent of cell division -- you should make a video for your project page!
You might be interested in this paper too: http://www.dgp.toronto.edu/papers/ahausner_SIGGRAPH2001.pdf This one uses GPU Voronoi + Lloyd's algorithm to generate mosaic tilings. The neat trick here is to use a Manhattan distance instead of a Euclidean one, in order to get voronoi cells to line up in mostly rectangular grids instead of approximating a hexagonal packing.
Matt, I'm very sorry. It was a genuine mistake. I always try hard to attribute sources (as you can see from the references in the doc, and on the couple of hundred other articles on my blog). It was nothing personal, it was an oversight :)
I've corrected this now on the site. Sorry again. Thanks for bringing this to my attention.
Regards
/\/ick
Note that the DataGenetics article talks about 2D Voronoi cells but they (and K-Means as well) can be generalized to a space of any dimensionality.
https://www.cosy.sbg.ac.at/~held/projects/vroni/vroni.html
you need the medial axis for v-carving, to control the CNC like so: https://youtu.be/jJhaDHmXvsY?t=1m15s
If you generate a Voronoi tesselation for a set of points, you can then merge neighboring areas to create isoclines
> If you create a dual graph of a Voronoi diagram (connect each node to every other node that shares an edge), you end up with a graph that is a Delaunay Triangulation
[1]: http://www.cs.utah.edu/~maljovec/files/DT_on_the_GPU_Print.p...
EDIT: I have a little devlog about the game I'm developing full-time, back in October 2015 I made a video where I talked through the first pass of my Voronoi/Navmesh implementation. Might be worth watching if anyone wants to see the tesselation overlaid onto a game world, for a real-life usage of the algorithms: https://www.youtube.com/watch?v=zPD3HqI6HDE I should assure everyone that the game looks _very_ different now thought! No more checkerboard textures...
I think this is an earlier version of the same presentation
It was interesting to hear about the use by an early epidemiologist to find the bad water source during the cholera outbreak in London.
http://chofter.com/mapviewer/voronoi.php
Pardon my pre-web-engineer lack of HTML knowledge, I was young and mind melded with robots at the time :-)
I wrote a paper on it long ago, the third one listed here if you're interested
Voronoi helped us once to make a game: https://www.airconsole.com/play/multiplayer-games/polyracer
man voronoi:
“This implementation takes advantage of the OpenGL depth buffer to compute the cells for us, by rendering the intersection of overlapping cones in an orthographic plane.”