Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PImage img;
- int slices = 21;
- float unit, theta;
- void setup() {
- img = loadImage("tmp-0.gif");
- size(img.width, img.height);
- unit=height/slices;
- frameRate(10);
- }
- void draw() {
- img = loadImage("tmp-"+(frameCount-1)%21+".gif");
- image(img, 0, 0);
- for (int i=0; i<slices; i++) {
- //int i=5;
- float edgeX = map(sin(theta+i*(TWO_PI/slices)), -1, 1, 0, width*.05);
- float edgeY = map(sin(theta+i*(TWO_PI/slices)), -1, 1, 0, height*.05);
- int y = int(i*unit);
- blend(img, 0, y, width, int(unit), int(-edgeX), int(y-edgeY), int(width+edgeX), int(unit+2*edgeY), SCREEN);
- }
- theta += TWO_PI/slices;
- //if (frameCount<slices+1) saveFrame("image-####.gif");
- //if (frameCount==slices) noLoop();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement