Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PImage img;
- int slices = 10;
- float unit, theta;
- void setup() {
- img = loadImage("pic1.jpg");
- size(img.width, img.height);
- unit=height/slices;
- }
- void draw() {
- image(img, 0, 0);
- for (int i=0; i<slices; i++) {
- float scal = map(sin(theta),-1,1,1,1.3);
- int y = int(i*unit);
- copy(img,0,y,width,int(unit),0,y,width, int(unit*scal));
- }
- theta += TWO_PI/slices;
- //if (frameCount<11) saveFrame("image-####.gif");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement