Skip to content

Instantly share code, notes, and snippets.

@eveevans
Created November 28, 2017 07:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eveevans/ab2f49318d74bf3050f5940ff500a2ea to your computer and use it in GitHub Desktop.
Save eveevans/ab2f49318d74bf3050f5940ff500a2ea to your computer and use it in GitHub Desktop.
/**
* Loop.
*
* Shows how to load and play a QuickTime movie file.
*
*/
PGraphics pg;
import processing.video.*;
Movie movie;
void setup() {
size(640, 360, P3D);
background(0);
pg = createGraphics(640,360, P3D);
// Load and play the video in a loop
movie = new Movie(this, "transit.mov");
movie.loop();
}
void movieEvent(Movie m) {
m.read();
}
void draw() {
//if (movie.available() == true) {
// movie.read();
//}
background(30);
pg.beginDraw();
pg.background(0,0,0,0);
pg.noStroke();
pg.fill(255);
pg.smooth();
pg.ellipse(width/2,height/2, 200, 200);
pg.endDraw();
movie.mask( pg.get() );
image(movie, mouseX - width/2, mouseY - height/2, width, height);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment