Madeline Gannon – Schotter

by Madeline Gannon @ 10:17 pm 11 January 2011

Applet

embedded js
Click white space below to activate!

Open Frameworks demo video

Code done in Processing 1.2.1

/*
 Madeline Gannon
 madeline.gannon@gmail.com
 IACD 01.10.2011
 "the gauntlet"
  DYNAMIC
*/
 
PFont f;
 
void setup() {
  size(300+50,500+50);  // canvas @ 3:5 ratio; 12 squares per row is 25 pixels
  background(255);
  frameRate(6);
  smooth();
  // initial text
  f = loadFont("Verdana-16.vlw");
  fill(0);
  textAlign(CENTER);
  String instructions = "Please Click to Generate";
  text(instructions, width/2, height/3);
  String title = "Schotter | Georg Nees | 1965";
  textAlign(LEFT);
  text(title, width/2, 11*height/12);
}
 
void draw() {
  if (mousePressed == true) {
    background(255);
    rectMode(CENTER);
 
    // initialize constants
    // square dims
    int xPos = (width-50)/12;
    int yPos = (height-50)/20;
    // row and col lengths
    int row = (height-50)/yPos;
    int col = (width-50)/xPos;
    // initial deviation @ (0,0)
    int deviation = 0;
    // random angle manipulated by deviation
    int randAngle = 45/(deviation+row);
 
     for (int i=0; i<row; i++) {
      // grow the deviation
      deviation+=randAngle;
      for (int j=0; j<col; j++) {
        pushMatrix();
        // make standard grid
        translate(j*xPos+row, i*yPos+col); 
        // apply randomized rotation
        rotate(radians(random(-deviation,deviation)));
        noFill();
        rect(18,25,xPos,yPos);  // (18,25) accounts for canvas offset
        popMatrix();
      }
    }
  }
}

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.
(c) 2019 Interactive Art & Computational Design / Spring 2011 | powered by WordPress with Barecity