Sechs Kursabende à vier Stunden an der EB Zürich
Kurskonzeption und Leitung Hanna Züllig
/* Autor: Peter Seidel Kurs: Einblick in die generative Gestaltung mit processing ip971241 Kursleitung: Hanna Zuellig Veroeffentlicht unter der creative common license Attribution-NonCommercial-ShareAlike CC BY-NC-SA http://creativecommons.org/licenses/ */ int[] data; PFont font; float anglestep; float winkel=0; int r=200; void setup() { size(600,600); background(255); // The text from the file is loaded into an array. String[] stuff = loadStrings("sketches/kurstag06/Peter_Seidel/data/data.txt"); // This array has one element because the file only has one line. // Convert String into an array of integers using ',' as a delimiter data = int(split(stuff[0], ',' )); font=loadFont("sketches/kurstag06/Peter_Seidel/data/Rockwell-Light-12.vlw"); //font = createFont("Rockwell-Light", 12); textFont(font); anglestep=TWO_PI/data.length; //textSize(64); } void draw() { background(TWO_PI); fill(0); winkel=0; colorMode (HSB,TWO_PI,100,100); int[] sorted= sort(data); //Kreiiert einen neune Datensatz sortiert=sorted. Und lässt "data" als unsortierten Code bestehen // data=sort(data); for (int i = 0; i < sorted.length; i ++ ) { // The array of ints is used to set the color and height of each rectangle. float s=map(data[i],min(data),max(data),0,100); float b=map(data[i],min (data),max(data),0,100); float xpos=300+cos(winkel)*r+i; float ypos=300+sin(winkel)*r+i; //float l=map(data[i], min(data), max(data), r/2,r); fill(winkel,100,100); //rotate(winkel); //rect(xpos,ypos,10,data[i]*-1); //fill(0); //text(data[i],(i*10)-5,500-data[i]-5); //text(360/data.length); text(sorted[i],xpos,ypos); winkel=anglestep+winkel; } }