// filler3d v.05 - elout de kok may 4 - 2004 // processing - v.67 // using the undocumented BGraphics BGraphics buff1,buff2,buff3,buff4,buff5; BGraphics filbuff01,filbuff02,filbuff03; int fillw=1200; int fillh=1200; // used for fps int new_sec,old_sec,my_fps,temp_fps; int midx,midy; float rotator; int r1,g1,b1; float rota; int temp,tempr; void setup() { size(600,400); buff1 = new BGraphics(width,height); buff2 = new BGraphics(width,height); buff3 = new BGraphics(width,height); buff4 = new BGraphics(width,height); buff5 = new BGraphics(width,height); midx=width/2; midy=height/2; filbuff01 = new BGraphics(fillw,fillh); filbuff02 = new BGraphics(fillw,fillh); filbuff03 = new BGraphics(fillw,fillh); filbuff01.background(255); filbuff02.background(255); filbuff03.background(255); changefill(); buff1.background(255); buff2.background(255); buff3.background(255); buff4.background(0); buff5.background(155); noStroke(); rota=random(PI);//random(PI);//(random(15)+0.1); } void loop() { push(); imageMode(CENTER_DIAMETER); translate(midx, midy); rotate(random(PI)); temp=(int)random(3); int tt=(int)random(1000); if (temp==0) { image(filbuff01, 0, 0, width*3-tt, width*3-tt); System.arraycopy( pixels, 0, buff1.pixels, 0, width*height); // source,start, destiny,start , size } if (temp==1) { image(filbuff02, 0, 0, width*3-tt, width*3-tt); System.arraycopy( pixels, 0, buff2.pixels, 0, width*height); // source,start, destiny,start , size } if (temp==2) { image(filbuff03, 0, 0, width*3-tt, width*3-tt); System.arraycopy( pixels, 0, buff3.pixels, 0, width*height); // source,start, destiny,start , size } pop(); buff4.background(0); buff4.push(); buff5.push(); buff4.translate(midx, midy,0); buff5.translate(midx, midy,0); int tem=(int)random(3); if (tem==0){buff4.rotateX(rota);buff5.rotateX(rota);} if (tem==1){buff4.rotateY(rota);buff5.rotateY(rota);} if (tem==2){buff4.rotateZ(rota);buff5.rotateZ(rota); } float ntx=random(400)-200; float nty=random(400)-200; float ntz=random(160)-80;//-100; buff4.translate(ntx,nty,ntz); buff5.translate(ntx,nty,ntz); int tx=(int)random(200)+10; int ty=(int)random(10)+10; int tz=-(int)random(200); buff4.noStroke(); buff5.noStroke(); fill(255); drawvlak(tx,ty,tz); buff5.fill(255,255,255, 200); drawvlak2(tx+6,ty+6,tz); buff5.fill(0,0,0, 200); drawvlak2(tx+4,ty+4,tz); buff5.pop(); buff4.pop(); for(int i=0;i> 16) & 0xff)>0) { if (temp==0) { r1= ((buff1.pixels[i] >> 16) & 0xff); g1= ((buff1.pixels[i] >> 8) & 0xff); b1= ( buff1.pixels[i] & 0xff); } if (temp==1) { r1= ((buff2.pixels[i] >> 16) & 0xff); g1= ((buff2.pixels[i] >> 8) & 0xff); b1= ( buff2.pixels[i] & 0xff); } if (temp==2) { r1= ((buff3.pixels[i] >> 16) & 0xff); g1= ((buff3.pixels[i] >> 8) & 0xff); b1= ( buff3.pixels[i] & 0xff); } buff5.pixels[i] = ( (0xff<<24) | ( r1 << 16) | ( g1 << 8) | b1); } } imageMode(CORNER); image(buff5, 0, 0, width, height); //quick and dirty fps counter my_fps++; new_sec=second(); if (new_sec!=old_sec) { old_sec=new_sec; temp_fps=my_fps; my_fps=0; status(" - elout de kok ©2004 - fps: "+ temp_fps); } //just add a little delay so system can handle other stuff as well delay(5); } void mousePressed() { rota= random(PI); buff5.background(155); changefill(); } void changefill() { filbuff01.background(255); filbuff02.background(255); filbuff03.background(255); tempr=(int)random(3); switch (tempr) { case 0: fillcirc(filbuff01, 0, 0, 100, 100); break; case 1: filllines(filbuff01, 0, 0, 100, 100); break; case 2: fillblok(filbuff01, 0, 0, 100, 100); break; } tempr=(int)random(3); switch (tempr) { case 0: fillcirc(filbuff02, 100, 0, 0, 100); break; case 1: filllines(filbuff02, 100, 0, 0, 100); break; case 2: fillblok(filbuff02, 100, 0, 0, 100); break; } tempr=(int)random(3); switch (tempr) { case 0: fillcirc(filbuff03, 0, 0, 0, 100); break; case 1: filllines(filbuff03, 0, 0, 0, 100); break; case 2: fillblok(filbuff03, 0, 0, 0, 100); break; } } void fillcirc(BGraphics mybg, int r, int g, int b, int a) { for (int i=0;i