/// <summary> /// The main entry point for the application. /// </summary> static void Main(string[] args) { using (Game1 game = new Game1()) { game.Run(); } }
public Camera(Vector3 position, Vector3 target, float near, float far , Game1 game , Matrix View,Matrix Proj) { if (position == target) target.Z += 10f; this.position = position; this.target = target; this.device = game.GraphicsDevice; this.nearPlane = near; this.farPlane = far; // If the camera's looking straight down it has to be fixed CalculateYawPitch(); while (Math.Abs(pitch) >= MathHelper.ToRadians(80)) { this.position.Z += 10; CalculateYawPitch(); } projection = Proj; view = View; //projection = Matrix.CreatePerspectiveFieldOfView(MathHelper.PiOver4, device.Viewport.AspectRatio, nearPlane, farPlane); //view = Matrix.CreateLookAt(this.position, target, this.Up); }