Issuu on Google+

FLUFFYCHAOS s a l v a t o r e

i a c o n e s i

Fluffy Chaos by Salvatore Iaconesi http://www.artisopensource.net Š2014 Art is Open Source

FLUFFYCHAOS s a l v a t o r e

i a c o n e s i

A graphic representation of data abstracted from the banks of every computer in the human system. Unthinkable complexity. Lines of light ranged in the nonspace of the mind, clusters and constellations of data. Like city lights, receding. William Gibson

Fluffy Chaos is the first book of the Generativity series. It explores the spaces of generative visuals. Spaces in which the laws of nature become entangled with programming code to describe possible scenarios. The books of the series showcase the images and the code used to produce them.

The code can be executed using the Processing language (http://www.processing.org).

the CODE

float W,H; Spark k; float rm,rM,gm,gM,bm,bM; float initialradius; float maxRadius,maxa; int num; void setup(){ size(3000,3000); //size(800,800); W = width; H = height; rm = 200; rM = 255; gm = 200; gM = 255; bm = 20; bM = 200; initialradius = 900; maxRadius = 10; num = 8; maxa = PI/6.0;

}

generate(); smooth(); noLoop();

void draw(){ background(0); stroke(0,0,0,20); noFill(); /* k.applyForce( 0.00003 ); if(random(0,100)>95){ k.applyForce( 0.003 ); } */ //k.process(); k.display(); noLoop(); //saveFrame(“fluff-######.tga”); } void generate(){ k = new Spark(W/2.0,H/2.0,initialradius,num,maxa); } void mouseReleased(){ generate(); loop(); }

void keyReleased(){ }

saveFrame(“fluff-######.tiff”);

class Spark{ float x,y,r; int n;

ArrayList<SubSpark> sub; public Spark(float xx, float yy, float rr, int nn, float maxda){ x = xx; y = yy; r = rr; n = nn; sub = new ArrayList<SubSpark>(); float da = TWO_PI/(float)n; for(int i = 0; i<n; i++){ SubSpark s = new SubSpark( 0, 0, r , da*(float)i, maxda, n ); sub.add(s); } } void applyForce(float force){ for(int i=0; i<sub.size(); i++){ SubSpark s = sub.get(i); s.applyForce(force); } } void process(){

}

for(int i=0; i<sub.size(); i++){ SubSpark s = sub.get(i); s.process(); }

void display(){ pushMatrix(); translate(x,y); for(int i=0; i<sub.size(); i++){ SubSpark s = sub.get(i); s.display(); } popMatrix();

} }

class SubSpark{ PVector v; float angle,radius,ia; float x,y, xi,yi; float rc,gc,bc; float acceleration, speed; ArrayList<SubSpark> sub; public SubSpark(float xx, float yy, float rr, float aa, float maxda, int maxn){ rc = (rM-rm)*random(0,1) + rm; gc = (gM-gm)*random(0,1) + gm; bc = (bM-bm)*random(0,1) + bm; angle = aa; ia = aa; radius = rr; x = xx; y = yy; xi = x; yi = y; v = new PVector(0,1); v.normalize(); v.mult(radius); acceleration = 0; speed = 0; sub = new ArrayList<SubSpark>(); float r2 = radius*0.5; if(r2>4){ int nn = round( random(1,maxn) ); for(int i = 0; i<nn; i++){ float r = random(0,1); float x1 = r*v.x; float y1 = r*v.y; float aaa = random(-maxda,maxda); SubSpark ss = new SubSpark(x1,y1,r2,aaa,maxda,maxn); sub.add(ss); } }

} void applyForce(float force){ acceleration= acceleration + force;

for(int i = 0; i<sub.size(); i++){ SubSpark s = sub.get(i); s.applyForce(force); } } void process(){ float inertia = -0.002*speed; applyForce(inertia); speed = speed + acceleration; acceleration = 0; angle = angle + speed; float rigid = (ia - angle)*0.05; angle = angle + rigid; for(int i = 0; i<sub.size(); i++){ SubSpark s = sub.get(i); s.process(); } } void display(){ pushMatrix(); translate(x,y); rotate(angle); //strokeWeight(maxRadius*radius/initialradius); stroke(rc,gc,bc,20); line(0,0,v.x,v.y); for(int i = 0; i<sub.size(); i++){ SubSpark s = sub.get(i); s.display(); } popMatrix(); }


Fluffychaos