// amoebaAbstract_03 // Copyright 2003 Marius Watz // http://www.evolutionzone.com/ // // Abstract computational animation for the exhibition "Abstraction // Now", Künstlerhaus Vienna, 29.08-28.09 2003. // // You are allowed to play with this code as much as you like, but // you may not publish pieces based directly on it. The Vec2D class // can be used freely in any context. // int num,cnt,colNum,colScheme; float h,maxSpeed; float[] x,y,speed; boolean initialised; float[] colR,colG,colB; void setup() { size(700,400); background(255); smooth(); framerate(30); ellipseMode(CENTER_DIAMETER); cnt=0; maxSpeed=8f; num=20; x=new float[num]; y=new float[num]; speed=new float[num]; h=height/num; for(int i=0; i50) speed[i]=-speed[i]; } noStroke(); colR=new float[1000]; colG=new float[1000]; colB=new float[1000]; colScheme=-1; initColors(); } void loop() { int c; cnt++; for(int i=0; iwidth) x[i]-=width; c=((i*11+cnt*3+int(speed[i]*10))/20)%colNum; if(c<0) c=0; fill(colR[c],colG[c],colB[c],150); if(i%2==0) rect(x[i]%width,y[i],6,h); else ellipse(x[i]%width,y[i]+h/2,h-6,h-6); } stroke(255,255,255,10); noFill(); strokeWeight(2); for(int i=0; i