int leftBounds = 20 -200; int topBounds = 20 -200; int x = leftBounds; int y = topBounds; int rightBounds = 380 -200; int bottomBounds = 380 -200; int baseMax = 20; int randomMax = 10; int maxLines = 400; int counter = 0; int alpha = 20; Line[] Lines; //Ellipse[] Ellipses; PImage myMask; void setup(){ size(400, 400); colorMode(HSB, 360, 100, 100); background(0, 0, 100); Lines = new Line[maxLines]; // Ellipses = new Ellipse[maxLines]; myMask = loadImage("mask.png"); strokeWeight(1); smooth(); } void draw(){ pushMatrix(); background(0,0,100); if(counter < maxLines){ int maxDistance = baseMax * floor(random(0, 1) * randomMax); int minDistance = 2; int direction = random(0, 1) < 0.5 ? -1 : 1; int xEnd = x + (direction * (minDistance + int( random(0, 1) * maxDistance)) ); direction = random(0, 1) < 0.5 ? -1 : 1; int yEnd = y + (direction * (minDistance + int( random(0, 1) * maxDistance)) ); if(xEnd < leftBounds) xEnd = leftBounds; if(xEnd > rightBounds) xEnd = rightBounds; if(yEnd < topBounds) yEnd = topBounds; if(yEnd > bottomBounds) yEnd = bottomBounds; translate(200, 200); rotate(counter/PI/360); Lines[counter] = new Line(x, y, xEnd, yEnd); Lines[counter].setAlpha(alpha); Lines[counter].setWeight(maxDistance/20); // Ellipses[counter] = new Ellipse(x, y, maxDistance * .2, maxDistance * .2); x = xEnd; y = yEnd; } else { translate(200, 200); rotate(counter/PI/360); } counter++; // alpha++; // if(alpha > 100) alpha = 0; // if(counter >= 10 && counter maxLines && counter < maxLines+10) { // Lines[counter-10].disappear(); // } // else if(counter > maxLines+10) noLoop(); if(counter < maxLines){ for(int i=0; i