Ciao 访客, welcome back to old school! :p
import processing.opengl.*;import processing.pdf.*;PImage img; int cellsize = 2; float yOffset;boolean recordOrNot = false;void setup() { size(500, 600, P3D); frameRate(30); smooth(); imageMode(CENTER); zOffset=0; img = loadImage( "1230.jpg" );}void draw() { if (recordOrNot) { beginRecord(PDF, "Output.pdf"); } background(0); img.loadPixels(); for (int i = 0; i < width/2; i++ ) { for (int j = 0; j < height/2; j++ ) { int x = i*2 + 1; int y = j*2 + 1; int loc = x + y*width; color c = img.pixels[loc]; float z = zOffset * brightness(color(c)); pushMatrix(); translate(x, y, z); stroke(c); point(0, 0); popMatrix(); } } zOffset+=0.005; if (recordOrNot) { endRecord(); recordOrNot = false; }}void mousePressed() { recordOrNot = true;}
import processing.pdf.*;import processing.opengl.*;float spacing;float yStart;float xStart;float a;float cSeed;float c;float r;boolean recordOrNot = false;void setup() { size(500, 500,OPENGL); smooth(); colorMode(HSB); //spacing=20; frameRate(8); //cSeed=random(20); }void draw() { if(recordOrNot) { beginRecord(PDF, "Output.pdf"); } background(0); lights(); translate(width/2, width/2); for (int i=0;i<1000;i++) { noStroke(); fill(random(100), 360, 255); c=noise(cSeed); cSeed+=1; pushMatrix(); translate(cos (a)*r,sin( a)*r ); a= degrees((i+1)*19);r=dist(mouseX,mouseY,width/2, width/2); ellipse (cos (a)*r,sin( a)*r,1.7,1.7); //sphere(4); popMatrix(); pushMatrix(); translate(cos (a)*(r-15),sin( a)*(r-15)); a= degrees(i);r=dist(mouseX,mouseY,width/2, width/2);//rotateZ(((radians(frameCount)+i)));//rotateX(((radians(frameCount)+i)));//sphere(2);// box(dist(mouseX,mouseY,width/2, width/2)*3,20, 20); //translate(100,0 ); //sphere(5); //translate(-200,0 ); popMatrix(); pushMatrix(); translate(cos (a)*(r-30),sin( a)*(r-30) ); a= degrees((i+1)*10);r=dist(mouseY,mouseX/2.4,width/2, width/2);ellipse (cos (a)*r,sin( a)*r,0.6,0.6); //sphere(1); popMatrix(); pushMatrix(); translate(cos (a)*r,sin( a)*r ); a= degrees((i+1)*3.777);r=dist(mouseX,mouseY,width/2, width/2);ellipse (cos (a)*r,sin( a)*r,2,2); //sphere(8);popMatrix(); } if(recordOrNot) { endRecord(); recordOrNot = false; }}void mousePressed() { recordOrNot = true; }