我想用處理將紋理應用到3D空間中的網格,我已經試過聲明PImage並設置有沒有結果的LoadImage .jpg文件..應用紋理電網
PImage tex;
void setup() {
size(800, 600, P3D);
tex=loadImage("ground104");
noCursor();
}
void draw()
{
directionalLight(255, 255, 255, 0, 0, -1);
background(180);
drawPlane();
}
void drawPlane()
{ //lights();
int s = 10000;
int ss = 500;
fill(0, 200, 20); stroke(200); for(int i = 0; i < s; i += ss) {
stroke(0,100,0);
strokeWeight(3);
beginShape(QUAD_STRIP);
for(int j = 0; j <= s; j += ss)
{
texture(tex);
vertex(j, i, 0);
vertex(j, i + ss, 0);
}
endShape(); } noStroke(); }
你有什麼建議嗎? 謝謝!
要麼'填充(0,200,20);'或'中風(0,100,0) ;'如果我猜測,很可能是中風。如果您正在應用紋理,我會建議刪除所有填充,中風和strokeWeight調用。 – JAMESSTONEco 2013-03-06 16:24:02