class Drizzle{ float t = 0.0; float f = 0.0; int i =0; int count01 =0; int count02 = 100; int delayNum = 0; float Rw, Rh, Rmax; float xoff = t; float SavePw, SavePh; int Rx, Ry; Drizzle(){ Rx = int(random(0, width)); Ry = int(random(0, height)); Rw = random(20, 30); Rh = random(Rw-5, Rw+5); Rmax = Rw*random(1.001, 1.03); } void display(){ if(count01 < 5){ drawDot(); } else if(count01 ==5){ Rmax = Rw*random(1.0001, 1.01); count01++; } else if(count01 <10){ drawDot2(); } else{ Rx = int(random(0, width)); Ry = int(random(0, height)); count01 =0; Rw = random(10, 40); Rh = random(Rw-5, Rw+5); } } void drawDot(){ fill(0, 80); float start = random(TWO_PI); float f = start; beginShape(POLYGON); float xoff = random(1000); int fcount =0; while(f <= start+TWO_PI) { float NoiseW = noise(xoff)*Rw; float NoiseH = noise(xoff)*Rh; if(f ==0){ SavePw = NoiseW; SavePh = NoiseH; } if(f == 143){ NoiseW = SavePw; NoiseH = SavePh; } vertex(Rx+cos(f)*random(NoiseW, NoiseW+2), Ry+sin(f)*random(NoiseH-2, NoiseH+2)); f += PI/72.0; fcount++; xoff += 0.02; } endShape(); Rw = Rw*1.01; Rh = Rh*1.01; fcount =0; count01++; } void drawDot2(){ fill(0, random(5, 15)); float start = random(TWO_PI); float f = start; float xoff = random(1000); beginShape(POLYGON); while(f < start+TWO_PI) { vertex(Rx + cos(f)*random(Rmax-10,Rmax), Ry + sin(f)*random(Rmax-10,Rmax)); f += PI/40.0; } endShape(); Rmax = Rmax*random(1.01, 1.05); count01++; xoff += 0.02; } }