WebGL interactive Voronoi diagram
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
demo Add a resolution demo. Jun 1, 2014
glsl Fallback when instancing is not available. May 31, 2014
js
lib
.gitignore Add Octave demonstration animation. Jun 1, 2014
README.md
UNLICENSE Initial working code. May 5, 2014
index.html
voronoi.css Initial working code. May 5, 2014

README.md

WebGL Interactive Voronoi Diagram

Play with it online! : http://skeeto.github.io/voronoi-toy/

Video, for non-WebGL capable browsers: WebM H.264

You can drag the vertices around on the fly with your mouse.

  • left-click : place a new vertex or move an existing vertex
  • right-click : remove a vertex
  • A : toggle animation

The diagram is computed and rendered entirely in the GPU via a fragment shader. There's a slow HTML5 canvas fallback for when WebGL is unavailable. Due to OpenGL ES's very small uniform constraints (as little as 16 4-component elements), even high-end GPUs will generally only support around 64 vertices in this demo.