Einblick in die generative Gestaltung mit «Processing»

Sechs Kursabende à vier Stunden an der EB Zürich

Kurskonzeption und Leitung Hanna Züllig


< back

						
// P_2_1_1_04.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
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/**
 * shapes in a grid, that are always facing the mouse
 * 	 
 * MOUSE
 * position x/y        : position to face
 * 
 * KEYS
 * s                   : save png
 * p                   : save pdf
 */

//import processing.pdf.*;
boolean savePDF = false;

PShape currentShape;

int tileCount = 10;
float tileWidth, tileHeight;




void setup(){
  size(600, 600);
  background(255);
  smooth();

  tileWidth = width/float(tileCount);
  tileHeight = height/float(tileCount);
 

  currentShape = loadShape("sketches/kurstag03/doris_pinsel/pinsel.svg");
} 


void draw(){
  if (savePDF) beginRecord(PDF, timestamp()+".pdf");

  background(255);
  smooth();

  for (int gridY=0; gridY 20) {
      tileCount = 10;
    }
    tileWidth = width/float(tileCount);
    tileHeight = height/float(tileCount);
  }

  
}


String timestamp() {
  Calendar now = Calendar.getInstance();
  return String.format("%1$ty%1$tm%1$td_%1$tH%1$tM%1$tS", now);
}