Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // based upon P_4_1_2_01.pde
- //
- // Generative Gestaltung, ISBN: 978-3-87439-759-9
- // First Edition, Hermann Schmidt, Mainz, 2009
- // Hartmut Bohnacker, Benedikt Gross, Julia Laub, Claudius Lazzeroni
- // Copyright 2009 Hartmut Bohnacker, Benedikt Gross, Julia Laub, Claudius Lazzeroni
- //
- // http://www.generative-gestaltung.de
- //
- PImage img;
- void setup() {
- background(0);
- img = loadImage("http://media-cache-ak0.pinimg.com/736x/2c/f6/a5/2cf6a58f75b368949cf98db03b925f1b.jpg");
- size(img.width+200, img.height);
- image(img, 100, 0);
- frameRate(5);
- }
- void draw() {
- int x1 = 0;
- int y1 = (int) random(0, height);
- int y2 = round(y1 + random(-7, 7));
- int x2 = round(random(-5, 5));
- int w = width;
- int h = (int) random(35, 50);
- copy(x1, y1, w, h, x2, y2, w, h);
- }
- void keyReleased() {
- if (keyCode == DELETE || keyCode == BACKSPACE) {
- background(0);
- image(img, 0, 100);
- }
- if (key=='s' || key=='S') saveFrame("image_##.png");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement