Hi! I’m working on a project for university and I’m having some difficulties with Processing.
Concept: There are two pictures and the program makes a transition by transparency from one picture to another, by moving the mouse from left to right. The program is working but from now, I’d like to use something better than the mouse to make the transition between both pictures. I’d like to use a webcam to make people interact with my work.
Basically, if somebody is on the left, Picture A appears. And if he/she walks to the right Picture B appears.
The problem is that I’m a beginner, so I can modify some lines of the code but I’m really bad at writing the whole program. I’d appreciate if somebody could help me fixing my problem. Here is where I am:
PImage one,two;
void setup(){
// Size of the background. Has to be the same as both pictures.
size(1199,787,P3D);
one = loadImage("RT21.jpg");
two = loadImage("RT22.jpg");
}
void draw(){
// Background is the first image (here: RT21.jpg)
background(one);
// Second imges appears according to the position of the mouse.
tint(255,255,255,(255.0/width)*pmouseX);
image(two,0,0);
}