int[] xpos = new int[100];
int[] ypos = new int[100];
void setup() {
size(600,600);
smooth();
// Initialize
for (int i = 0; i < xpos.length; i ++ ) {
xpos[i] = 0;
ypos[i] = 0;
}
}
void draw() {
background(255);
// Shift array values
for (int i = 0; i < xpos.length-1; i ++ ) {
xpos [i] = xpos[i + 1];
ypos[i] = ypos[i + 1];
}
// New location
xpos[xpos.length-1] = mouseX;
ypos[ypos.length-1] = mouseY;
// Draw everything
for (int i = 0; i < xpos.length-1; i ++ ) {
noStroke();
fill(255-i*5);
ellipse(xpos[i],ypos[i],40,40);
}
}
This code by Daniel Shiffman. I want to create this effect on live video. I am new in processing.
Instead of a circle I want to show some frames with a particular interval. After that It should gonna fadeout.
I tried some logic but it wont work.
I wish your help.