Advertisement
xeromino

piano

Jun 3rd, 2014
370
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.49 KB | None | 0 0
  1. PImage img;
  2. int step=3;
  3. float theta;
  4.  
  5. void setup() {
  6.   img = loadImage("http://i.imgur.com/rVnFQo3.jpg");
  7.   size(img.width, img.height);
  8.   println(width, height);
  9. }
  10.  
  11. void draw() {
  12.   image(img, 0, 0);
  13.   step = (int) random(1, 8);
  14.   for (int y=0; y<height/2; y+=step) {
  15.     int mx = (int) random(width/5);
  16.     copy(img, 0, y, width-mx, step, mx, y, width-mx, step);
  17.     copy(img, width-mx, y, width, step, 0, y, mx, step);
  18.   }
  19.  
  20.   //if (frameCount<18) saveFrame("image-###.gif");
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement