Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // based on code from:
- // P_2_1_1_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
- int tileCount = 10;
- int actRandomSeed = 0;
- int actStrokeCap = ROUND;
- float sw0, sw1, theta;
- void setup() {
- size(500, 500);
- }
- void draw() {
- background(#E2C1A9);
- noFill();
- randomSeed(actRandomSeed);
- sw0=map(sin(theta),-1,1,10,20);
- sw1=sw0*4;
- for (int gridY=0; gridY<tileCount; gridY++) {
- for (int gridX=0; gridX<tileCount; gridX++) {
- int posX = width/tileCount*gridX;
- int posY = height/tileCount*gridY;
- int toggle = (int) random(0, 2);
- if (toggle == 0) {
- strokeCap(PROJECT);
- strokeWeight(sw1);
- stroke(#B88D86,150);
- line(posX, posY, posX+width/tileCount, posY+height/tileCount);
- }
- if (toggle == 1) {
- strokeCap(ROUND);
- strokeWeight(sw0);
- stroke(#47022B);
- line(posX, posY+width/tileCount, posX+height/tileCount, posY);
- }
- }
- }
- theta += 0.0523*2;
- //if (frameCount % 2 == 0 && frameCount < 61) saveFrame("image-###.gif");
- }
- void mousePressed() {
- actRandomSeed = (int) random(100000);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement