Calibrate works?
This commit is contained in:
parent
26e34f7671
commit
cc711c6343
1104 changed files with 636510 additions and 75 deletions
39
lib/video/examples/Movie/Scratch/Scratch.pde
Normal file
39
lib/video/examples/Movie/Scratch/Scratch.pde
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
/**
|
||||
* Scratch
|
||||
* by Andres Colubri.
|
||||
*
|
||||
* Move the cursor horizontally across the screen to set
|
||||
* the position in the movie file.
|
||||
*/
|
||||
|
||||
import processing.video.*;
|
||||
|
||||
Movie mov;
|
||||
|
||||
void setup() {
|
||||
size(640, 360);
|
||||
background(0);
|
||||
|
||||
mov = new Movie(this, "transit.mov");
|
||||
|
||||
// Pausing the video at the first frame.
|
||||
mov.play();
|
||||
mov.jump(0);
|
||||
mov.pause();
|
||||
}
|
||||
|
||||
void draw() {
|
||||
|
||||
if (mov.available()) {
|
||||
mov.read();
|
||||
// A new time position is calculated using the current mouse location:
|
||||
float f = map(mouseX, 0, width, 0, 1);
|
||||
float t = mov.duration() * f;
|
||||
mov.play();
|
||||
mov.jump(t);
|
||||
mov.pause();
|
||||
}
|
||||
|
||||
image(mov, 0, 0);
|
||||
}
|
||||
|
||||
BIN
lib/video/examples/Movie/Scratch/data/transit.mov
Normal file
BIN
lib/video/examples/Movie/Scratch/data/transit.mov
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue