off topic somewhat - the aforementioned attempt at a feedback effect:
Code:
static final int SIZE = 200;
static final int HSIZE = 100;
// double buffers
PGraphics front;
void setup() {
size(SIZE, SIZE, P2D);
front = createGraphics(SIZE, SIZE, P2D);
frameRate(20);
}
void draw() {
int x = (int)random(-5, 5);
int y = (int)random(-5, 5);
int r = (int)random(128, 255);
int g = (int)random(128, 255);
int b = (int)random(128, 255);
front.beginDraw();
front.translate(HSIZE, HSIZE); // move origin to centre
// copy saved image to foreground, twisted and a bit larger
front.rotate(.02);
front.scale(1.06);
// copy from current image
front.image(this.g, -HSIZE, -HSIZE, SIZE + 1, SIZE + 1);
// draw something new on screen
front.fill(r, g, b);
front.noStroke();
front.rectMode(CENTER);
front.ellipse(x, y, 5, 5);
front.endDraw();
// copy image to screen
image(front, 0, 0);
}
the colours fade too quickly. i am not sure why.