Advertisement
xeromino

marlon

Aug 2nd, 2014
349
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.72 KB | None | 0 0
  1. PImage img;
  2. int slices = 21;
  3. float unit, theta;
  4.  
  5. void setup() {
  6.   img = loadImage("tmp-0.gif");
  7.   size(img.width, img.height);
  8.   unit=height/slices;
  9.   frameRate(10);
  10. }
  11.  
  12. void draw() {
  13.   img = loadImage("tmp-"+(frameCount-1)%21+".gif");
  14.   image(img, 0, 0);
  15.   for (int i=0; i<slices; i++) {
  16.     //int i=5;
  17.     float edgeX = map(sin(theta+i*(TWO_PI/slices)), -1, 1, 0, width*.05);
  18.     float edgeY = map(sin(theta+i*(TWO_PI/slices)), -1, 1, 0, height*.05);
  19.     int y = int(i*unit);
  20.     blend(img, 0, y, width, int(unit), int(-edgeX), int(y-edgeY), int(width+edgeX), int(unit+2*edgeY), SCREEN);
  21.   }
  22.   theta += TWO_PI/slices;
  23.   //if (frameCount<slices+1) saveFrame("image-####.gif");
  24.   //if (frameCount==slices) noLoop();
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement