final int maxVertices = 2<<8; float x[] = new float[maxVertices]; float y[] = new float[maxVertices]; int numVertices = 0; boolean pmousePressed = false; void setup(){ size(640,480); } void draw(){ background(0); stroke(255); if (mousePressed && !pmousePressed && numVertices < maxVertices){ x[numVertices] = mouseX; y[numVertices] = mouseY; numVertices++; } if (keyPressed && key == 'r'){ x = new float[maxVertices]; y = new float[maxVertices]; numVertices = 0; } Triangle[] triangulated = triangulatePolygon(x,y,numVertices); Polygon[] polys = polygonizeTriangles(triangulated); if (triangulated != null){ for (int i=0; i