1
我正在使用以下代碼繪製立方體。如何繪製立方體,立方體和金字塔
// Re-creates the default perspective
size(100, 100, P3D);
noFill();
smooth();
float fov = PI/3.0;
fill(25, 210, 12);
float cameraZ = (height/2.0)/tan(fov/2.0);
perspective(fov, float(width)/float(height),
cameraZ/10.0, cameraZ*10.0);
translate(50, 50, 0);
rotateX(-PI/6);
rotateY(PI/3.5);
box(45);
調用透視方法會導致立方體以虛線顯示,如何修改代碼以獲得實線。
processing.js上面是否有任何庫提供了構建這些3D形狀的簡單包裝。