0
我在XNA上的圖元有問題。正如您在鏈接http://imgur.com/12UTd2s中看到的那樣,某些紋理牆壁是透明的,有些則不是。有人可以解釋爲什麼發生這種情況,並幫助我想出一個解決方案?XNA紋理圖元透明
這裏的穿牆聲明中看到:
testWall.Add(new VertexPositionNormalTexture(new Vector3(x2, 0, z2), new Vector3(1, 0, 0), new Vector2(0,0)));
testWall.Add(new VertexPositionNormalTexture(new Vector3(x2, 0, z2 - 50), new Vector3(1, 0, 0), new Vector2(1,0)));
testWall.Add(new VertexPositionNormalTexture(new Vector3(x2, 20, z2), new Vector3(1, 0, 0), new Vector2(0,1)));
testWall.Add(new VertexPositionNormalTexture(new Vector3(x2, 20, z2), new Vector3(1, 0, 0), new Vector2(0,1)));
testWall.Add(new VertexPositionNormalTexture(new Vector3(x2, 20, z2 - 50), new Vector3(1, 0, 0), new Vector2(1,1)));
testWall.Add(new VertexPositionNormalTexture(new Vector3(x2, 0, z2 - 50), new Vector3(1, 0, 0), new Vector2(1,0)));
而這裏的牆的聲明我無法看透:
testWall.Add(new VertexPositionNormalTexture(new Vector3(x1, 0, z1 - 50), new Vector3(-1, 0, 0), new Vector2(0,1)));
testWall.Add(new VertexPositionNormalTexture(new Vector3(x1, 0, z1), new Vector3(-1, 0, 0), new Vector2(0,0)));
testWall.Add(new VertexPositionNormalTexture(new Vector3(x1, 20, z1 - 50), new Vector3(-1, 0, 0), new Vector2(1,1)));
testWall.Add(new VertexPositionNormalTexture(new Vector3(x1, 20, z1 - 50), new Vector3(-1, 0, 0), new Vector2(1,1)));
testWall.Add(new VertexPositionNormalTexture(new Vector3(x1, 20, z1), new Vector3(-1, 0, 0), new Vector2(1,0)));
testWall.Add(new VertexPositionNormalTexture(new Vector3(x1, 0, z1), new Vector3(-1, 0, 0), new Vector2(0,0)));
剔除設置爲無,X2,X1,Z1 ,z2是頂點位置。有什麼想法嗎?
謝謝
它的工作!感謝隊友^^對不起,但我沒有足夠的聲望,以upvote你的答案 – 2014-09-30 21:37:21