Advertisement
Guest User

Untitled

a guest
Jun 3rd, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. import processing.video.*;
  2. Movie myMovie;
  3.  
  4. void setup() {
  5. size(1280, 720,P3D);
  6. myMovie = new Movie(this, "particulo.mp4");
  7. //myMovie.loop();
  8. myMovie.play();
  9. }
  10. int rOld;
  11. void draw() {
  12.  
  13.  
  14. int r = int(map(mouseY, 0, height, 1, 5));
  15. //println(r);
  16. if(rOld != r){
  17. myMovie.jump(r);
  18. rOld = r;
  19. }
  20. if (myMovie.available()) {
  21. //myMovie.read();}
  22. image(myMovie, 0, 0);
  23. }
  24. textSize(32);
  25. text(r, 20, 60);
  26. fill(255, 0, 0);
  27.  
  28.  
  29. //image(myMovie, mouseX, mouseY);
  30. }
  31.  
  32. // Called every time a new frame is available to read
  33. void movieEvent(Movie m) {
  34. m.read();
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement