public OpenGLControl() { camera = new Camera(new Spherical(8f, (float)Math.PI / 4,(float) Math.PI / 2)); //camera = new GhostCamera(); //projMatrix = Matrix4.CreateOrthographicOffCenter(-10f, 10f, -10f, 10f, 0.0001f, 10000f); projMatrix = Matrix4.CreatePerspectiveFieldOfView(1f, this.Width / this.Height, 1f, 100f); zoomMatrix = camera.lookAt(); }
public OpenGLControl() { camera = new SphericalCamera(new Spherical(8, (float)Math.PI / 2, 0)); projMatrix = Matrix4.CreatePerspectiveFieldOfView(0.7f, this.Width / this.Height, 0.15f, 100f); zoomMatrix = camera.lookAt(); refreshTimer.Interval = 20; refreshTimer.Elapsed += new ElapsedEventHandler(refreshTimer_Elapsed); }
public override void Process(Camera camera, GameTime gameTime) { #if DEBUG stopwatch.Restart(); #endif Game.GraphicsDevice.SetRenderTarget(null); Game.GraphicsDevice.BlendState = BlendState.AlphaBlend; Game.GraphicsDevice.Clear(Color.Black); spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.Default, RasterizerState.CullCounterClockwise); foreach (KeyValuePair<string, Texture2D> kvp in Inputs) if (kvp.Value != null) spriteBatch.Draw(kvp.Value, Vector2.Zero, Color.White); spriteBatch.End(); #if DEBUG processTimes.Enqueue((int)stopwatch.ElapsedTicks); while (processTimes.Count > 60) processTimes.Dequeue(); #endif }
public void setSphericalCamera(SphericalCamera cam) { camera = cam; camera_mode = CAMERA_MODE.SPHERICAL_CAMERA; refreshView(); }
public void setCarCamera(CarCamera cam) { camera = cam; camera_mode = CAMERA_MODE.CAR_CAMERA; refreshView(); }