based on Processing.js by John Resig
Example written by Casey Reas and Ben Fry