Advertisement
xeromino

dream

Mar 11th, 2014
534
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 slices = 50;
  3. float unit, theta;
  4.  
  5. void setup() {
  6.   img = loadImage("pic4.jpg");
  7.   size(img.width, img.height);
  8.   unit=height/slices;
  9.   frameRate(10);
  10. }
  11.  
  12. void draw() {
  13.   image(img, 0, 0);
  14.   for (int i=0; i<slices; i++) {
  15.     //int i=5;
  16.     float edgeX = map(sin(theta+i*(TWO_PI/slices)),-1,1,0,width*.05);
  17.     float edgeY = map(sin(theta+i*(TWO_PI/slices)),-1,1,0,height*.05);
  18.     int y = int(i*unit);
  19.     blend(img,0,y,width,int(unit),int(-edgeX),int(y-edgeY),int(width+edgeX), int(unit+2*edgeY), ADD);  
  20.   }
  21.   theta += TWO_PI/slices;
  22.  
  23.   //if (frameCount<slices+1) saveFrame("image-####.gif");
  24.    
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement