void showHelp() { fill(yellow,40); rect(0,0,height,height); pushMatrix(); translate(20,20); fill(dgreen); text(" Inertia moment of polygon, by Jarek Rossignac, 2007",0,0); translate(0,20); fill(dblue); translate(0,20); text("First click in the window to activate it. Press SPACE to show/hide this help text",0,0); translate(0,20); text("To edit the curve: click&drag vertices. Hold 'a' to add, 'd' to delete a vertex",0,0); translate(0,20); text("Hold 'f' (or 'q' if dragging) to fair the curve locally ",0,0); translate(0,20); text("Press 'S' to subdivide (refine) or 'C' to coarsen the curve",0,0); translate(0,20); text("Hold: 't' to translate , 'z' or 'Z' to zoom, 'r' or 'R' to rotate, 'e to drag it ",0,0); translate(0,20); text("Press 'G' to load a new curve, 'F' to fit it, '+' to axis align the edges",0,0); translate(0,20); text("Press 'V' to hide/show vertices",0,0); translate(0,20); text("The red circle is bounding a disk with the same inertia Iz as the polygon",0,0); translate(0,20); text("The center of mass G is the sum of aC for all edges AB divided by the sum of a, ",0,0); translate(0,20); text(" where a=areaTriangle(O,A,B) and C=(O+A+B)/3",0,0); translate(0,20); text("The moment is the sum of (GB*GA.left)(GA*GA+GA*GB+GB*GB)/12 for all edges AB, ",0,0); translate(0,20); text(" where * is the dot product and V.left=(-V.y,V.x)",0,0); translate(0,20); fill(dred); translate(0,20); popMatrix(); noFill(); }