GMU:Processing im Park/Dirk Wäsch/Code Hausaufgabe VI: Difference between revisions

From Medien Wiki
(Created page with "Processing v2.1.1 Quellcode: <br> <source lang="java"> code </source><br>")
 
No edit summary
 
Line 3: Line 3:
<br>
<br>
<source lang="java">
<source lang="java">
code
import processing.video.*;
</source><br>
Movie movie;
  size(960,540);
void setup(){
  movie = new Movie(this,"walk.mp4");
  movie.loop();
  background(0);
}
void movieEvent(Movie m){
  m.read();
}
void draw(){
  noStroke();
  for(int i = 0;i < 10000; i++){
    int x = (int(random(0, width)));
    int y = (int(random(0, height)));
    color c = movie.get(x,y);
    fill(c,100);
    rect(x,y,1,540);
  }
}
</source>

Latest revision as of 13:58, 28 January 2016

Processing v2.1.1 Quellcode:


import processing.video.*;
 
Movie movie;
 
  size(960,540);
void setup(){
  movie = new Movie(this,"walk.mp4");
  movie.loop();
  background(0);
}
 
void movieEvent(Movie m){
  m.read();
}
 
void draw(){
  noStroke();
  for(int i = 0;i < 10000; i++){
    int x = (int(random(0, width)));
    int y = (int(random(0, height)));
    color c = movie.get(x,y);
    fill(c,100);
    rect(x,y,1,540);
  }
}