I would like to have a video running in the background which is not seen at the start of the sketch but is slowly appearing as an ellipse is moved through the screen. I can do it with an image using a blend():
Code:
PImage a;
float xpos, ypos, pxpos, pypos;
// lets user control DisplayItems properties, value output and drawing attributes
void setup(){
a = loadImage("DSC00617.JPG");
background(0);
// set size and framerate
frameRate(10);
size(1580, 1050);
}
void draw(){
xpos = mouseX;
ypos = mouseY;
noStroke();
ellipse(xpos, ypos, 50, 50);
blend(a, 0,0,width,height,0,0,width,height, DARKEST);
}
But when I use a video instead I get all the images of the video superimposed on top of one another:
Code:
import processing.video.*;
Movie myMovie;
PImage a;
float xpos, ypos, pxpos, pypos;
// lets user control DisplayItems properties, value output and drawing attributes
void setup(){
background(0);
// set size and framerate
frameRate(10);
size(640, 480, P2D);
myMovie = new Movie(this, "station.mov");
myMovie.loop();
}
void movieEvent(Movie myMovie) {
myMovie.read();
}
void draw(){
xpos = mouseX;
ypos = mouseY;
noStroke();
ellipse(xpos, ypos, 50, 50);
blend(myMovie, 0,0,width,height,0,0,width,height, DARKEST);
}
It is also possible to get similar effect with a copy(), but then I can do it only with squares:
Code:
import processing.video.*;
Movie myMovie;
// lets user control DisplayItems properties, value output and drawing attributes
void setup(){
// set size and framerate
frameRate(10);
size(150, 150, P2D);
myMovie = new Movie(this, "station.mov");
myMovie.loop();
image(myMovie,0,0) ;
background(0);
}
void movieEvent(Movie myMovie) {
myMovie.read();
}
void draw(){
copy(myMovie,mouseX, mouseY,10, 10,mouseX, mouseY,10, 10);
}
How can I transform these squares into a circles?
Or modify my sketch with the blend() in order to get only one video?
Thanks!