/* ---------------------------------------------------------------- Copyright (C) 2005 Ricard Marxer Piñón email (at) ricardmarxer.com http://www.ricardmarxer.com/ ---------------------------------------------------------------- This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ---------------------------------------------------------------- Built with Processing (Beta) v098 uses Geomerative (Alpha) v004 ---------------------------------------------------------------- Created 17 January 2006 ---------------------------------------------------------------- dibuixant ---------------------------------------------------------------- */ import processing.opengl.*; import geomerative.*; RGroup grupo; Particle particula; float toldist; float maxvel; float maxalph; RFont f; //------------------------ Runtime properties ---------------------------------- // Save each frame boolean SAVEVIDEO = false; boolean SAVEFRAME = false; boolean APPLICATION = true; String DEFAULTAPPLETRENDERER = JAVA2D; int DEFAULTAPPLETWIDTH = 680; int DEFAULTAPPLETHEIGHT = 480; String DEFAULTAPPLICRENDERER = OPENGL; int DEFAULTAPPLICWIDTH = 800; int DEFAULTAPPLICHEIGHT = 600; //------------------------------------------------------------------------------ //------------------------ Drawing properties ---------------------------------- // Text to be drawn String STRNG = "Caligraft"; // Font to be used String FONT = "LidoSTF.ttf"; // Margin from the borders float MARGIN = 50; //------------------------------------------------------------------------------ //------------------------- Drawer properties ---------------------------------- // The coefficient of the velocity of getting to a desired point float MINNERVE = 0.002; float MAXNERVE = 0.005; // The average of mininertia and maxinertia must be under one to have good results float MININERTIA = 0.7; float MAXINERTIA = 1.2; // Coefficient that handles the error of the drawing: 0 for lowest error float DRWERRCOEFF = 1.0009; // Coefficient that handles the variation of amount of ink for the drawing float INKERRCOEFF = 0.5; // Coefficient that handles the amount of ink for the drawing float INKCOEFF = 0.3; // Coefficient of precision: 0 for lowest precision float PRECCOEFF = 0.8; // Velocity of the drawing int VELOCIDAD = 128; //----------------------------------------------------------------------------- String newString = ""; void setup(){ int w = DEFAULTAPPLICWIDTH, h = DEFAULTAPPLICHEIGHT; String r = DEFAULTAPPLICRENDERER; if(!APPLICATION){ // Specify the widtha and height at runtime w = int(param("width")); h = int(param("height")); r = (String)param("renderer"); // (String) will return null if param("renderer") doesn't exist if (r != OPENGL && r != P3D && r != JAVA2D && r != P2D) { r = DEFAULTAPPLETRENDERER; } // int() will return 0 if param("width") doesn't exist if (w <= 0) { w = DEFAULTAPPLETWIDTH; } // int() will return 0 if param("height") doesn't exist if (h <= 0) { h = DEFAULTAPPLETHEIGHT; } } size(w,h,r); framerate(25); try{ smooth(); } catch(Exception e){ } background(255); f = new RFont(this,FONT,372,RFont.CENTER); initialize(); } void draw(){ pushMatrix(); translate(width/2, height/2); for(int i=0;i