SamiaAhmed-Schotter
Schotter, processing.js
Schotter, processing
Schotter, openFrameworks
Schotter, code
//Samia Ahmed, samiaa@andrew.cmu.edu //A reproduction of Schotter by Georg Nees //Carnegie Mellon University: 51-482 //January 2011 int rows = 23; int cols = 12; int side; void setup(){ size(392, 700); side = width/(cols+2); background(248, 244, 236); noLoop(); } void draw(){ for (int row = 0; row < rows; row++){ for (int col = 0; col < cols; col++){ pushMatrix(); translate((side*col)+side/2+side, (side*row)+side/2+side); //resets the origin rotate(setRotation(row, col)); noFill(); rect(-(side/2)+setShift(row, col), -(side/2)+setShift(row, col), side, side); popMatrix(); } } } float setRotation(int row, int col){ float count = (row*cols+col); float rand = random(count); if (count > (rows*cols)/4 || random(rows*cols) < count) if (int(random(3)) == 1) return radians(90*(rand/(rows*cols))); else return -radians(90*(rand/(rows*cols))); return 0; } float setShift(int row, int col){ float count = (row*cols+col); float rand = random(count); if(count > (rows*cols)/4 || random(row*col) < count) if (int(random(3)) == 1) return (side/2*(rand/(rows*cols))); else return -(side/2*(count/(rows*cols))); return 0; } |
Comments Off on SamiaAhmed-Schotter