1
以下是我繪製某些由此處未顯示的頂點定義的形狀的方法。XNA - 如何繪製更遠的物體
Vector3 position = (5,5,1);
Matrix world = Matrix.CreateTranslation(position);
BasicEffect basicEffect = new BasicEffect(graphicsDevice);
Matrix view = Matrix.CreateLookAt(new Vector3(0, 0, -20), new Vector3(0, 0, 100), Vector3.Up);
Matrix projection = Matrix.CreatePerspectiveFieldOfView(MathHelper.PiOver4,
graphics.Viewport.AspectRatio,
1.0f,
100);
// Set BasicEffect parameters.
basicEffect.World = world;
basicEffect.View = view;
basicEffect.Projection = projection;
//....draw some shape with basicEffect
我想畫的形狀相同僅得更遠,而其中心停留在屏幕上的相同(X,Y)像素,但整體要小,因爲它是更遙遠。
我已經試過縮放位置矢量但與它沒有成功:
position .Z *= 2;
position .X *= 2;
position .Y *= 2;
什麼是做到這一點的正確方法?