//W:Mute 2004 - Abstract //www.wmute.org int siz=80; int hsiz=siz/2; int cores=20; float coreSites[][]= new float [cores][3]; float curveCPoints[][]= new float[cores][3]; boolean curveExists[][]= new boolean[cores][cores]; boolean curveDirection[][]= new boolean[cores][cores]; float curveOffset[][]=new float[cores][cores]; float curveSpeed[][]=new float[cores][cores]; float ay=0.0f; float az=0.0f; float day=0.002f; float daz=0.002f; float ac=0.0f; int w=640; int hw=w/2; float sscale = w/siz; int index=0; int output[]=new int[640*360]; void setup() { size(640,360); colorMode(HSB); background(0,0,0); index=0; for(int i=0; i<640; i++) { for(int j=0; j<360; j++) { output[index] = pixels[index]; index++; } } reset(); } void loop() { background(0,0,0); beginCamera(); perspective(50.0f, 1.0f, 1.0f, 1000.0f); translate(0.0f, 0.0f, -1.2*w); rotateY(ay+=day); rotateZ(az+=daz); endCamera(); if (mousePressed == true) { reset(); } if ((ac+=0.001)>1.0){ac-=1.0;}; for (int i=0; i1.0f){lac-=1.0f;}; if (curveDirection[i][j]){lac=1.0f-lac;}; float llac = lac-curveSpeed[i][j]*0.2f; float ulac = lac+curveSpeed[i][j]*0.2f; if (llac<0.0){llac=0.0f;}; if (ulac>1.0){ulac=1.0f;}; for (int k = 0; k <= 21; k++) { stroke(50+10*k,119,250); float dk=k/10.0f; if (k>10) {dk=2.0f-dk;}; float lt =0; if (curveDirection[i][j]){ lt= llac + k * k *(ulac-llac)/ 441.0f;} else{ lt= llac + k * k *(llac-ulac)/ 441.0f;} float lx=bezierPoint(sscale*coreSites[i][0],sscale*curveCPoints[i][0],sscale*curveCPoints[j][0],sscale*coreSites[j][0],lt); float ly=bezierPoint(sscale*coreSites[i][1],sscale*curveCPoints[i][1],sscale*curveCPoints[j][1],sscale*coreSites[j][1],lt); float lz=bezierPoint(sscale*coreSites[i][2],sscale*curveCPoints[i][2],sscale*curveCPoints[j][2],sscale*coreSites[j][2],lt); beginShape(LINE_STRIP); vertex(lx-dk, ly-dk,lz); vertex(lx-dk, ly+dk,lz); vertex(lx+dk, ly+dk,lz); vertex(lx+dk, ly-dk,lz); vertex(lx-dk, ly-dk,lz); endShape(); } } } } index=0; for(int i=0; i<640; i++) { for(int j=0; j<360; j++) { pixels[index] = blend(pixels[index], output[index],250) ; output[index] = pixels[index]; index++; } } } void reset() { day=-0.005+random(0.01); daz=-0.005+random(0.01); for (int i=0; i>8); } int blend(int a, int b, int f) { return mix(a>>16,b>>16,f)<<16 | mix(a>>8&0xff,b>>8&0xff,f)<<8 | mix(a&0xff,b&0xff,f); }