Пример #1
0
 // Ensures that all objects are being rendered from a consistent viewpoint
 public Camera(Project1Game game)
 {
     position = new Vector3(0, game.getHeight(0,0)+5, -10);
     target = new Vector3(0, 0, 0);
     up = Vector3.UnitY;
     View = Matrix.LookAtLH(position, target, up);
     Projection = Matrix.PerspectiveFovLH((float)Math.PI / 4.0f, (float)game.GraphicsDevice.BackBuffer.Width / game.GraphicsDevice.BackBuffer.Height, 0.1f, (float)Math.Pow(2, game.scale) + 1);
     this.game = game;
 }
Пример #2
0
 // Ensures that all objects are being rendered from a consistent viewpoint
 public Camera(Project1Game game)
 {
     position   = new Vector3(0, game.getHeight(0, 0) + 5, -10);
     target     = new Vector3(0, 0, 0);
     up         = Vector3.UnitY;
     View       = Matrix.LookAtLH(position, target, up);
     Projection = Matrix.PerspectiveFovLH((float)Math.PI / 4.0f, (float)game.GraphicsDevice.BackBuffer.Width / game.GraphicsDevice.BackBuffer.Height, 0.1f, (float)Math.Pow(2, game.scale) + 1);
     this.game  = game;
 }