/* Name: Spark Description: Version: 1.1 Author: Noritaka Horio Website: http://sharedhat.com/ */ float r = 50; float x = 0; float y = 0; void setup() { size(width,height); background(#FFFFFF); smooth(); noStroke(); x = width / 2; y = height / 2; frameRate(15); } void draw() { drawEllipses(); fadeOut(); } void drawEllipses () { if (r >= width) { noLoop(); } else { drawEllipse(x, y, r); drawEllipse(x, y, r); r = r + 10; fadeOut(); } } void drawEllipse (float x, float y, float r) { fill(color( random(0, 255), random(0, 255), random(0, 255), random(0, 100) )); for (int i = 0; i < 36; i++) { float drawX = cos(i * 10) * random(r, r + 50) + x; float drawY = sin(i * 10) * random(r, r + 50) + y; ellipse(drawX, drawY, random(10, 20), random(10, 20)); } } void fadeOut () { fill(color(255,255,255,10)); rect(0, 0, width, height); }