//***************************************************************************** // TITLE: Edge-Triangle Intersection // DESCRIPTION: Solution for class projects. Assumes general position. // AUTHOR: Prof Jarek Rossignac // DATE CREATED: August 2008 // EDITS: Lines modified from the sample code given are marked wuth //*: and numbered in the order of creation //***************************************************************************** boolean showHelpText=true; // toggled by keys to show/hide help text boolean debugging=false; // temporarily set when key '?' is pressed (see TAB UI). can be used to print some debugging statements once void setup() { size(600, 600); // set window size smooth(); // activates antialiasing (slower but removes jaggies). Incompatible with P3D setColors(); // assigns colors in TAB colors PFont font = loadFont("ArialMT-24.vlw"); textFont(font, 18); // *:44 load font declarePoints(); resetPoints(); // initializes vertices in TAB polygon } void draw() { background(121); // sets background if (showHelpText) showHelp(); // show help text OR else myActions(); // execute my actions in TAB actions debugging=false; // reset debugging to avoid printing twice }; // end of draw