Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float y, theta;
- PImage img;
- float[] len;
- void setup() {
- img = loadImage("http://media-cache-ak0.pinimg.com/736x/8b/13/4e/8b134e2309e76aced0bcd9ed3d8bf9cf.jpg");
- size(400, 400);
- background(0);
- noFill();
- strokeCap(SQUARE);
- len = new float[height];
- for (int y=0; y<height;y++) {
- len[y]=random(width/2);
- }
- }
- void draw() {
- image(img, 0, 0);
- for (int y=0; y<height;y++) {
- stroke(get(width/2, y), 255);
- float myX = map(sin(theta+TWO_PI/height*y), -1, 1, 0, len[y]);
- line(width/2, y, width/2-myX, y);
- }
- theta += 0.0523*2;
- //if (frameCount%2==0 && frameCount<61) saveFrame("image-###.gif");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement