import processing.video.*; import processing.opengl.*; Capture c; //Clock cc; int w=9500; float sinx; void setup(){ size(800,600,P3D); c = new Capture(this, 600, 400, 30); //cc = new Clock(width-200,300,10); } void draw(){ background(255); camera(700,height/2-200-mouseY,700+mouseX,width/2+900,height/2,0,0.0,1.0,0.0); //image(c, 0, 0); float fov = PI/2.0; float cameraZ = (height/2.0) / tan(PI * fov / 360.0); perspective(fov, float(width)/float(height), cameraZ/10.0, cameraZ*10.0); pushMatrix(); //noStroke(); //stroke(255,255,255,10); stroke(0,0,0,30); translate(1700,height/2+100,0); //fill(255,255,255,20); fill(0,0,0,20); box(width*60,50,250); popMatrix(); for(int i=0;i<30;i++){ pushMatrix(); translate(100+i*800,height/2+400,0); //stroke(255,255,255,5); //stroke(255,255,255,5); //fill(255,255,255,20); fill(0,0,0,30); box(50,550,150); popMatrix(); } sinx+=0.1; //beginShape(); for(int i=0;i<w;i+=10){ for(int j=0;j<360;j+=2){ //float rr=i*0.002; float rrr=i*0.001; float rr= 1*PI*cos((rrr+sinx)); float r = 50*cos(rr)+400; //fill(255-i,255,255,30); //stroke(255-i,255,255,80); //stroke(c.pixels[i*40]); float cr=red(c.pixels[i*10]); float cg=green(c.pixels[i*10]); float cb=blue(c.pixels[i*10]); stroke(cr,cg,cb,90); point(width/2+i,height/2+r*cos(radians(j))-130,r*sin(radians(j))); //vertex(width/2-w/2+i,height/2+r*cos(radians(j)),r*sin(radians(j))); } } //endShape(); } void captureEvent(Capture myCapture) { myCapture.read(); }
|