week08_1_loadShape_shape
size(400,500,P3D);
PShape gundam = loadShape("Gundam.obj");
translate(width/2,height/2); // 放到畫面中心
pushMatrix();
translate(0,100); // (5) 再往下移一點點,比較好看
scale(10,-10,10); // (4) 把模型放大 shape(10) 上下要再顛倒過來
shape(gundam,0,0); // (2) 畫出 3D 模型
popMatrix();
week08_2_PShape_gundam_setup_draw_push_scale_shape_pop
轉動它,要改成互動模式的程式風格
PShape gundam;
void setup(){
size(400,500,P3D);
gundam = loadShape("Gundam.obj");
}
void draw(){
background(100);
translate(width/2,height/2+100);
pushMatrix();
translate(-100,0,0);
rotateY(radians(frameCount));
scale(10,-10,10);
shape(gundam,0,0);
popMatrix();
pushMatrix();
translate(120,0,0);
rotateY(radians(frameCount));
scale(10,-10,10);
shape(gundam,0,0);
popMatrix();
}
week08_3_anthor_obj_large_bad_mtl
轉動它,要改成互動模式的程式風格
PShape gundam;
void setup(){
size(400,500,P3D);
gundam = loadShape("FinalBaseMesh.obj");
}
void draw(){
background(100);
translate(width/2,height/2+100);
pushMatrix();
translate(20,0,0);
rotateY(radians(frameCount));
scale(10,-10,10);
shape(gundam,0,0);
popMatrix();
}




沒有留言:
張貼留言