void scribe(String S) {fill(black); text(S,20,20); noFill();} void scribe(String S, int i) {fill(black); text(S,20,20+i*20); noFill();} void mousePressed() { if (mouse().isInWindow()) pickClosestPoint(); else ; } // select closest vertex (see TAB polygon) void keyPressed() { if (key==' ') showHelpText=!showHelpText ; if (key=='X') {String S=" "+"-####.tif"; saveFrame(S);}; ; if (key=='?') debugging=true; // toggle debug mode }; void showHelp() { fill(dblue); pushMatrix(); translate(20,20); text("Edge/Triangle intersection by Jarek Rossignac",0,0); translate(0,20); //*:45 text(" Red: edge(D,E) meet the interior of triangle(A,B,C) ",0,0); translate(0,20); //*:46 text(" Orange: edge(D,E) meet the boundary of triangle(A,B,C) ",0,0); translate(0,20); //*:47 text(" ",0,0); translate(0,20); text("First click in the window to activate it ",0,0); translate(0,20); text("Press SPACE to show/hide this help text",0,0); translate(0,20); text("Click & drag vertices ",0,0); translate(0,20); text(" ",0,0); translate(0,20); text("When running Processing (not in a web browser): ",0,0); translate(0,20); text("Press 'X' to snap a picture ()",0,0); translate(0,20); text("Press '?' to print your debugging stuff",0,0); translate(0,20); popMatrix(); noFill(); showColors(); // showing off various colors (helps you select the one you want) }