2009-04-28から1日間の記事一覧

approach-avoidance

意味は、葛藤。3Dプログラミングって、やってみたいけれど、難しそう。そんな葛藤があるよね。

proce55ingで3D まずはここから

void setup(){ size(400, 400, P3D); }void draw(){ background(0); translate(width/2, height/2); rotateY(frameCount*PI/60); box(150, 150, 150); } 箱がくるくる回ります。proce55ingにこのコードを貼り付けて、3Dの箱が表示されて「あっ、楽しいかも!…

processing proce55ing opengl 円柱

proce55ingでOPENGLを使おうとすると、基本図形が球と直方体しかないみたい。そこで、円柱を作った人がいる。以下は、そのまま動くコード。 import processing.opengl.*;float rad = 0; void setup(){ size(200, 200, OPENGL); } void draw(){ rad = rad + 1…

tiltshift

写真の周りをぼかす&色をくっきりさせることで作られるミニチュア画像。英語ではtiltshiftと言うみたい。http://www.flickr.com/search/?w=all&q=tiltshift&m=text

proce55ing translate popmatrix 3d

// Cubic Grid float boxSize = 40; float margin = boxSize*2; float depth = 400; color boxFill; void setup(){ size(400, 400, P3D); noStroke(); } void draw(){ background(255); // center and spin grid translate(width/2, height/2, -depth/2); ro…

proce55ing translate popMatrix()

void setup(){ size(400, 400, P3D); } void draw(){ background(0); translate(width/2, height/2); rotateY(frameCount*PI/60); pushMatrix(); translate(-50, -50); fill(255, 0, 0); box(100, 100, 100); popMatrix(); pushMatrix(); translate(50, -50)…

processing proce55ing sphere 3d rotate

void setup(){ size(400, 400, P3D); } void draw(){ background(0); translate(width/2, height/2); rotate(frameCount*PI/60); sphere(100); } rotate()が何を中心にして回るのかは置いておく。sphereで原点中心に球を描画。