boolean variation = false; void setup() { size(600, 600); frameRate(30); smooth(); noFill(); noStroke(); } void mousePressed() { variation = ! variation; } void draw() { float fr = radians(frameCount), speed = fr * 2, sfr = sin(fr); background(0, 0, 31); translate(width / 2, height / 2); rotate(fr); scale(height / sq(20 + 10 * (1 + sin(fr / 2)))); for (int j = -15; j < 15; j++) { for (float i = 0; i < 2 * PI; i += PI / 8) { float x = sin(i + speed), y = cos(i + speed) / 2; float r1 = (100 + y * 20) * y, r2 = (100 + y * 20) / 2; float o = 15 + y * 480, a = noise(i + j) + noise(frameCount) / 10; fill(o - a * 255 + 64 * sfr, a * 31 + 192 * sfr, 127 + a * o - 31 * sfr, o); stroke(192, 127 + o / 2); if (variation) y += 2 * sin(fr + i); ellipse(width / 4 * x + 100 * sin(radians(11 + j + frameCount * 0.1) * 30), height / 4 * y + j * height / 8, r1, r2); } } }