xeromino

glitch

Apr 1st, 2014
355
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.63 KB | None | 0 0
  1. PImage img;
  2. int counter;
  3. int scal = 10;
  4. float noiseVal;
  5.  
  6. void setup() {
  7.   img = loadImage("http://media-cache-ak0.pinimg.com/736x/8f/16/7a/8f167a7272c88412a7c9b5ee00fd8ae7.jpg");
  8.   size(500, img.height);
  9.   //image(img, 0, 0);
  10.   frameRate(5);
  11.   noiseVal = random(100);
  12. }
  13.  
  14. void draw() {
  15.   background(0);
  16.   int step =  int(random(1*scal, 2*scal));
  17.  
  18.   for (int y=0; y<height; y+=step) {
  19.     //int x = int(random(-1, 1)*20);
  20.     int x = (int) (noise(noiseVal)*width/2);
  21.     noiseVal += 0.01;
  22.     println();
  23.     copy(img, 0, y, width, step, x, y, width+x, step);
  24.     copy(img, width-x, y, x, step, 0, y, x, step);
  25.   }  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment