/** * Future Calligraphy IV * by Joseph Gray * * March 5th 2009 * */ float distance = 0; float px = 0, py = 0; int rand = 0, prevRand = 0, randDistance = 10; int i=0; // int curveMod = 30; // float randX = 0, randY = 0, prevRandX = 0, prevRandY = 0; // effects scale int mod = 5; int newOffX = -mod; int newOffY = -mod; int newWidth = (mod*2)+width; int newHeight = (mod*2)+height; void setup() { size(400, 400); frameRate(30); cursor(CROSS); smooth(); } void draw() { if (focused) { // ++i; if (i>255) i=222; fill(255, 255, i, 11); noStroke(); rect(0, 0, width, height); // randDistance = abs(prevRand-rand); rand = round(random(randDistance+50)); distance = abs(pmouseX-mouseX)*.5; stroke(10, 0, 255-i-33, 255); strokeWeight((distance+rand)*.1); randX = mouseX+(((curveMod*distance)*.5)-random((curveMod*distance))); randY = mouseY+(((curveMod*distance)*.5)-random((curveMod*distance))); bezier(pmouseX, pmouseY, prevRandX, prevRandY, randX, randY, mouseX, mouseY); // prevRand = rand; prevRandX = randX; prevRandY = randY; // filter(DILATE); blend(0, 0, width, height, -2, -1, width+2, height+1, BLEND); filter(ERODE); filter(INVERT); blend(0, 0, width, height, newOffX, newOffY, newWidth, newHeight, OVERLAY); filter(DILATE); filter(INVERT); // if(mousePressed) { blend(0, 0, width, height, newOffX, newOffY, newWidth, newHeight, ADD); filter(DILATE); } } }