From instruction: Complexity, intensity and disorder
Code: CoInDi by xgouchet
A simple Processing Application, with 3 sliders : Complexity, Intensity, Disorder.
The parameters control colored shapes.
Try it at : http://www.xgouchet.fr/blog/public/processing/CoInDi.html
/** * Complexity, Intensity, Disorder * Demo for the Instruction Set website [05/2008] * by Xavier Gouchet (http://www.xgouchet.fr/) * * Dependencies : ControlP5 library (http://www.sojamo.de/libraries/controlP5/) */ import controlP5.*; public ControlP5 cp5; public float complexity, intensity, disorder; public int hueval; void setup(){ // init applet size(640,480); frameRate(12); smooth(); // init GUI cp5 = new ControlP5(this); Slider sliderCo = cp5.addSlider("complexity", 0.0, 1.0, 0.5, 10, 160, 8, 64); Slider sliderIn = cp5.addSlider("intensity", 0.0, 1.0, 0.5, 65, 160, 8, 64); Slider sliderDi = cp5.addSlider("disorder", 0.0, 1.0, 0.5, 120, 160, 8, 64); complexity = intensity = disorder = 0.5; hueval = (int)random(256); } public void draw(){ colorMode(RGB,256); noStroke(); fill(192,192,192,64); rect(0,0,width,height); int count = (int) (25*complexity) + 2; for (int j=0; j<count; j++){ float x = (width/2) + (disorder*random(-width/5,width/5)); float y = (height/2) + (disorder*random(-height/5,height/5)); beginShape(); for (int i=0; i<24; i++){ float rad = (intensity*100) + (complexity*random(50)); float vx = x + (cos((i*2*PI)/24) * rad); float vy = y + (sin((i*2*PI)/24) * rad); colorMode(HSB,256); stroke(0); int brightnessval = 255; if (count>0) brightnessval = (int) ((j*256.0)/count); fill((hueval+(random(-30,30) * complexity)), intensity*256, brightnessval); vertex(vx,vy); } endShape(CLOSE); } hueval += random(-30,30) * disorder; if (hueval<0) hueval += 256; if (hueval>=256) hueval -= 256; }
[download]
Written in Processing. Released under the GPLv3 license