Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PImage img;
- float theta, setY;
- int frames = 35, py;
- void setup() {
- size(540, 540);
- img=loadImage("craig.gif");
- img.filter(INVERT);
- }
- void draw() {
- background(0);
- stroke(230);
- for (int x=0; x<width; x++) {
- float offSet = map(x, 0, width, 0, PI);
- float y = map(sin(theta+offSet*2), -1, 1, 0, 50);
- setY=height-y-py;
- line(x, height, x, setY );
- }
- blend(img,0,0,width, height,0,0,width, height,SUBTRACT);
- println(frameCount, setY);
- py+=5;
- saveFrame("image-###.gif");
- if (setY<-50) noLoop();
- theta += TWO_PI/frames;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement