// Based on the Cursor example on page 257 import processing.pdf.*; ////////////////////////////////////////////////////// modification for forkable.eu String outputdir = "tmp/"; /////////////////////////////////////////////////////////////////////////////////// boolean record = false; int gx, gy; int mode, nextmode; int nummodes; boolean forapplet = false; float mx, my, lastmx, lastmy; float lastrot, lastsc; float bgx, bgy; float p_x, p_y; float p_fx, p_fy; float p_v2, p_vx, p_vy; float p_a2, p_ax, p_ay; float p_mass, p_drag; void setup() { size(442, 550); gx = width; gy = height; colorMode(RGB, 1.0); strokeWeight(0.5); strokeJoin(ROUND); nummodes = 4; mode = 4; bgx = 0; bgy = 0; mx = gx/2; my = gy/2; } void draw() { if(record) { beginRecord(PDF, "page_254.pdf"); // Start writing to PDF } lastmx = mx; lastmy = my; mx = mouseX; my = mouseY; background(1.0); beginRecord(PDF, outputdir + "page_254.pdf"); // modification for forkable.eu // Grid fill(1,1,1); stroke(.2,.2,.2); float rot; for (int i=16; i