下面是我如何绘制一些由此处未显示的顶点定义的形状。
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;
这样做的正确方法是什么?