Advertisement
xeromino

wave

Apr 23rd, 2015
488
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.55 KB | None | 0 0
  1. PImage img1;
  2. int posX, posY, w, h, frames=90;
  3. float theta, d;
  4.  
  5. void setup() {
  6.   img1 = loadImage("pic2.jpg");
  7.   size(540, img1.height);
  8.   w = 200;
  9.   h = 200;
  10.   d = 100;
  11. }
  12.  
  13. void draw() {
  14.   image(img1, 0, 0);
  15.   for (int x=0; x<width; x++) {
  16.     float offSet = TWO_PI/width*x;
  17.     for (int i=0; i<75; i++) {
  18.       int y = int(height/2+i + sin(theta+offSet*1)*50);
  19.       color col1= img1.get(x, y+i);
  20.       set(x, y, col1);
  21.     }
  22.   }
  23.   //ellipse(posX,posY,10,10);
  24.   theta += TWO_PI/frames;
  25.   if (frameCount<=frames) saveFrame("image-###.gif");
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement