Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PImage img;
- int slices = 50;
- float unit, theta;
- void setup() {
- img = loadImage("pic4.jpg");
- size(img.width, img.height);
- unit=height/slices;
- frameRate(10);
- }
- void draw() {
- 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), ADD);
- }
- theta += TWO_PI/slices;
- //if (frameCount<slices+1) saveFrame("image-####.gif");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement