Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // based upon: http://www.openprocessing.org/sketch/191377
- PImage foto;
- int fx = 296, fy = 254, frames = 60, d=100;
- float theta;
- void setup() {
- frameRate(10);
- foto = loadImage("jb.jpg");
- size(foto.width, foto.height);
- }
- void draw() {
- int mx = int(width*.6+sin(theta)*width*.2);
- int my = int(height/2+cos(theta)*height*.2);
- copy(foto, 0,0, fx, fy, 0,0, mx, my); // alto sinistra
- copy(foto, fx,0, foto.width-fx, fy, mx,0, width-mx, my); // alto destra
- copy(foto, 0,fy, fx, foto.height-fy, 0,my, mx, height-my); // basso sinistra
- copy(foto, fx,fy, foto.width-fx, foto.height-fy, mx,my, width-mx, height-my); // basso destra
- theta += TWO_PI/frames;
- if (frameCount<=frames) saveFrame("image-###.gif");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement