//***************************************************************************** // TITLE: Template // DESCRIPTION: // AUTHOR: Prof Jarek Rossignac // DATE CREATED: October 2008 // EDITS: //***************************************************************************** import processing.opengl.*; boolean showHelpText=true; // toggled by keys to show/hide help text boolean printIt=false; // temporarily set when key '?' is pressed and used to print some debugging values int myWidth = 800; int myHeight = 800; void setup() { PFont font = loadFont("Courier-14.vlw"); textFont(font, 14); // load font /*smooth();*/ /*strokeJoin(ROUND); strokeCap(ROUND);*/ rectMode(CENTER); // set up window and drawing modes frameRate(30); size(800, 800, OPENGL); setColors(); myInit(); // initialize } void draw() { background(121); strokeWeight(1); // sets background if (showHelpText) showHelp(); else myActions(); printIt=false; }; // end of draw //*** KEY ACTIONS (details in keys tab) void keyPressed() { keys(); }; void mousePressed() { if (!meshMode) myMousePressed(); else { C.anchor(); C.pose(); if (keyPressed&&((key=='m')||(key=='w')) ) {C.setMark(); M.hitTriangle();}; }; // record where the cursor was when the mouse was pressed } void mouseReleased() { if (!meshMode) myMouseReleased(); else { C.anchor(); C.pose(); } // reset the view if any key was pressed when mouse was released }