Hi,
I’m trying to overlay a drawing sketch on a movie. The sketch I’m using is “RandomWalkLevy” from Daniel Shiffman’s “The Nature of Code”, which calls two functions in the main draw() block. However, the trace of the drawing movement is erased by the new frames of the video. I have tried adapting the code here
to create a top layer to put the drawing code. However, I’m not sure what to put between topLayer.beginDraw(); and topLayer.endDraw(); to make the Walker code work.
Any help greatly appreciated.
Thanks,
Peter
import processing.video.*;
Movie myMovie;
PGraphics topLayer;
void setup()
{
size(640, 480);
myMovie = new Movie(this, “station.mov”);
myMovie.loop();
topLayer = createGraphics(width, height, g.getClass().getName());
}
void movieEvent(Movie myMovie)
{
myMovie.read();
}
void draw()
{
image(myMovie, 0,0, width, height);
topLayer.beginDraw();
topLayer.noFill();
topLayer.stroke( 255 );
topLayer.line( pmouseX, pmouseY, mouseX, mouseY );
topLayer.endDraw();
image( topLayer, 0, 0 );
}