0
我需要使用處理語言創建具有不同高度的3D塊網格。如何使用處理語言創建3d塊網格?
現在我停留在這樣的輸出: 3D block grid with varying height(Current Output)
代碼上面的輸出:
import peasy.*;
import peasy.org.apache.commons.math.*;
import peasy.org.apache.commons.math.geometry.*;
import peasy.test.*;
import processing.serial.*;
PeasyCam cam;
//float i1,i2,i3;
void setup() {
size(800, 800, P3D);
//smooth(4);
cam = new PeasyCam(this, 200);
cam.setMinimumDistance(100);
cam.setMaximumDistance(200);
}
void draw() {
background(200);
randomSeed(30);
for(int x=-50;x<=50;x+=18)
{
for(int y=-50;y<=50;y+=18)
{
pushMatrix();
translate(x,y,0);
boxT();
popMatrix();
}
}
}
void boxT()
{
fill(random(255), random(255), random(255), random(255));
strokeWeight(4);
translate(0,0,0);
box(10,10,random(50));
}
現在,我所需的輸出是高矮不一,這些3D塊但一個共同基地飛機東西是這樣的: 3D block grid with varying heights(Desired Output)
在此先感謝!