hey! i need to make a kind of a snow effect and so i thought i could blur some ellipses but the problem is i don't know how to only apply blur once to an ellipse... it keeps adding to the whole frame ( or stage or something) and the ellipses keep getting more blurry as other ellipses are blured on top
i thought i make something like only applying if the frameCount is less or equal than 1, and reset the frameCount everytime i draw an ellipse but it doesnt work...
here is my code
Code: import processing.pdf.*;
Bolas b1 = new Bolas();
PImage img;
void setup(){
// size(640,480,PDF, "postal.pdf");
size(640,480,P2D);
smooth();
background(255);
img = loadImage("arvore.jpg");
}
void draw(){
for(int i = 0; i < 10; i++) {
// noStroke();
int x = (int)random(width);
int y = (int)random(height);
color col = img.get(x,y);
fill(col);
float prop = random(20);
float prop2 =prop;
//ellipseMode(CENTER);
noStroke();
pushMatrix();
b1.desenhar(x,y,prop,prop);
popMatrix();
}
}
class Bolas{
Bolas(){
frameCount = 0;
}
void desenhar(int x, int y , float prop, float prop2){
ellipse(x,y,prop,prop);
if(frameCount<2){
filter(BLUR,5);
}
}
}