Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PImage img1;
- int posX, posY, w, h, frames=240;
- float theta, d;
- void setup() {
- img1 = loadImage("pic2.jpg");
- size(540,img1.height);
- posX = int(random(width));
- posY = int(random(height));
- w = h = 200;
- d = 100;
- }
- void draw() {
- image(img1, 0, 0);
- posX = int(width/2+cos(theta)*d);
- posY = int(height/2+sin(theta)*d);
- for (int x=posX-w/2; x<posX+w/2; x++) {
- for (int y=posY-h/2; y<posY+h/2; y++) {
- color col1= img1.get(x+10, y);
- set(x, y, col1);
- }
- }
- //ellipse(posX,posY,10,10);
- theta += TWO_PI/frames;
- if (frameCount<=frames) saveFrame("image-###.gif");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement