int mw = 792; int mh = 1050; linea [] lineasArr; int currentLinea = 0; lineaGris [] lineasArrGris; int currentLineaGris = 0; int cuantasLineasGris = mh; int contador, contadorGris; BImage c; float xLogo, yLogo; void setup() { size(mw, mh); background(255, 255, 255); lineasArr = new linea[10000]; c = loadImage("logo2.jpg"); xLogo = (mw/2)-(c.width/2); yLogo = (mh/2)-(c.height/2); image(c, xLogo, yLogo); int cuantasColumnas = c.width; int cuantasFilas = c.height; int currentCol = 0; int currentFila = 0; for (int i=0; imw || y<0 || y>mh) fd++; else change(); } } void pintarLogo() { stroke(0,0,0); point(xInit, yInit); } void change() { r = getRadio(); dir = dir*-1; d = d-180; cx = x-(r*cos(radians(d))); cy = y-(r*sin(radians(d))); fd = int(random(90)); counter = 0; } float getRadio() { float currentDist = distance(x, y, xLogo+(c.width/2), yInit+(c.height/2)); r = int(random(50)+50); return r; } float distance(float x1, float y1, float x2, float y2) { return sqrt(sq(x1-x2) + sq(y1-y2)); } } class lineaGris { int id; float x = mw/2+10; float xOld = x; float y = mh/2+20; float yOld = y; int r = int(random(10)+10); int c = int(random(195)+60); lineaGris(int i) { id = i; } void pintar() { if (id%25!=0) return; float r1 = random(10); float r2 = random(10); x = xOld+r*cos(r1); y = yOld+r*cos(r2); stroke(c, c, c); line(xOld, yOld, x, y); xOld = x; yOld = y; } }