Drawing graphene with WebGL

This page uses WebGL 2 and fairly recent javascript features. Check the console for errors.

Graphene is a fascinating material with an interesting, chicken-wire like shape. Unfortunately, this shape is kind of difficult to draw. Not impossibly difficult, just annoyingly difficult. Here I draw it with WebGL. I do not load a huge buffer of precomputed vertex coordinates. Instead, I compute the vertex coordinates in the shader, in a procedural way.

Letf-clik and drag with the mouse to rotate the view. Use the mouse wheel to zoom in and out. Panning is not yet implemented.