image trail effect
in
Programming Questions
•
1 year ago
Hello All, I am trying to mask the one Image using the another image of based on the position of the mouse. Only the surface where the mouse move will get masked and it should create the trail effect which slowly fades out(say 5 sec) after the mouse passes the area.
So far I have archieved to get trail effect but I am having problem with the masking. this is my code which I have used. im my code i want to display image pixels instead of ellipse.
PImage img;
int val = 255;
PImage myImg;
//int a = 10;
void setup() {
size(640, 480);
frameRate(30);
img = loadImage("building.jpg");
//image(img,0,0, width, height);
myImg = loadImage("denmark.jpg");
noStroke();
smooth();
}
void draw() {
// background(0);
tint(255, val);
image(myImg, 0, 0);
fill(0, 10);
rect(0, 0, width, height);
}
void mouseMoved(){
val = 0;
// a = 255;
fill(255, 0, 0, 255);
noStroke();
ellipse(mouseX, mouseY, 60, 60);
}
1