Created
November 28, 2017 07:44
-
-
Save eveevans/ab2f49318d74bf3050f5940ff500a2ea to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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