January 12, 2012
Posted by Clinton Montague
Generative art experiment 1: Rainbow with a headache
int frame = 0; void setup () { size (800, 300); background(0); smooth (); } void draw () { int step = 10; float lastx = -999; float lasty = -999; float ynoise = random(10); float y; float xsteps = width; float ysteps = 100; colorMode(HSB, ysteps); for (int i = 0; i < ysteps; i++) { for (int x = 0; x < xsteps; x++) { y = (height / ysteps) * i + (noise(ynoise) ) * 80 - 40; if (lastx > -999) { stroke (i, 100, 100); line (x, y, lastx, lasty); } lastx = x; lasty = y; ynoise += 0.1; } } if (frame > 20 && frame < 500) { // you can use quicktime to convert the image sequence to a movie. saveFrame ("frame-####.png"); } frame++; }










No Comments Yet
You can be the first to comment!
Leave a comment