ango-Asemic
Paper Prototyping
Personal rule based drawing exercise:
Light Play
Code Iterations
void setup() { size(600, 700); noLoop(); } void draw() { background(255); stroke(0); for(int i = 0; i < 30; i++){ translate(0, 120); drawLine(); } } float sign(float x) { if(x < 0) return -1.0; else return 1.0; } void drawLine() { pushMatrix(); beginShape(); noFill(); float x = 5; float y = 5; float prevx = x; int counter = 0; while (x < (width-100)) { float upOrDown = 1.0; //(random(5 - y, 5 - y)); float dx = random(40, 80); if (counter%2 == 1) { dx -= 25 * upOrDown; } float ex = randomGaussian() * 5; if (counter%2 == 1) { ex -= 25 * upOrDown; } float dy = randomGaussian() * 5; if (counter%2 == 1) { dy += 25 * sign(dy); } float ey = -abs(randomGaussian()*20); dy += ey * upOrDown; curveVertex (x, y); curveVertex (x+dx, y); curveVertex (x+dx, y-dy); curveVertex (x+dx-ex, y-dy); curveVertex (x+dx-ex, y-dy+ey); fill(0); noFill(); x = x+dx-ex; y = y-dy+ey; counter++; } endShape(); popMatrix(); } |