int A = 3, B = 2; void setup() { size(500, 500, P3D); frameRate(25); textFont(createFont("Helvetica", 8, true)); textMode(SCREEN); } void mousePressed() { A = (int) random(-10, 10); B = (int) random(-10, 10); } void draw() { background(0, 31, 31); translate(width / 2, height / 2); for (int z = -1000; z < 500; z += 15) { float r = sin(radians(frameCount)); float xoff = width / 4 * sin(A * radians(z / 15 + frameCount) + PI / 2), yoff = height / 4 * sin(B * radians(z / 15 + frameCount)); stroke(255, map(z, -1000, 500, 0, 255)); for (float a = 0; a < 2 * PI; a += PI / 32) { float x = width / 2 * sin(a + r), y = height / 2 * cos(a + r); point(xoff + x, yoff + y, z); } } text("A = " + A + ", B = " + B, 0, height); }