我需要绘制一个地形,并在XNA中有一个带有surfacefollow的相机,但是在某些地方它并没有绘制绘制的东西并绘制它背后的地形。有什么建议吗?
public void Draw()
{
camera.Effect.TextureEnabled = true;
camera.Effect.VertexColorEnabled = false;
camera.Effect.World = worldMatrix;
camera.Effect.Texture = texture;
camera.Effect.CurrentTechnique.Passes[0].Apply();
device.SetVertexBuffer(vertexBuffer);
device.Indices = indexBuffer;
for (int i = 1; i < (alturas.Height - 1); i++)
{
device.DrawIndexedPrimitives(PrimitiveType.TriangleStrip, 0, 0, heights.Width * 2, (heights.Width * 2) * i, (heights.Width * 2) - 2);
}
}
高度是高度图的纹理。顶点的构造工作正常。