// Dartmouth CS 2, Winter 2009, Chris Bailey-Kellogg // Notes 9 | Sketch 4 size(300,300); // Create lines from points; try varying the spacing (R&F 6-05) for (int x=0; x<100; x+=10) { point(x, 5); } for (int x=100; x<200; x+=5) { point(x, 5); } for (int x=200; x<300; x++) { point(x, 5); } // Spacing can be geometric for (float x=1; x<300; x*=1.2) { point(x, 20); } // Add some noise (Greenberg 6-07) for (int x=0; x<100; x++) { point(x, 50+random(-5,5)); } // Spreading (Greenberg 6-08) float h=0, dh=0.2; for (int x=0; x<100; x++) { point(150+x, 50+random(-h,h)); h += dh; } // Gradient -- change color with position (R&F 6-04) for (int x=0; x<256; x+=2) { stroke(x); line(x, 100, x, 150); } // Random-colored bullseye (based on R&F 6-03) stroke(0); smooth(); for (int d=100; d > 0; d -= 20) { fill(random(255),random(255),random(255)); ellipse(150, 230, d, d); }