protected override void Draw(GameTime gameTime)
        {
            graphics.GraphicsDevice.Clear(Color.CornflowerBlue);

            //draw coordcross
            cCross.Draw(fpsCam.ViewMatrix, fpsCam.ProjectionMatrix);

            terrain.Draw(Matrix.Identity, fpsCam.ViewMatrix, fpsCam.ProjectionMatrix);

            base.Draw(gameTime);
        }
Ejemplo n.º 2
0
        protected override void Draw(GameTime gameTime)
        {
            device.Clear(ClearOptions.Target | ClearOptions.DepthBuffer, Color.Black, 1, 0);

            cCross.Draw(fpsCam.ViewMatrix, fpsCam.ProjectionMatrix);

            //draw terrain
            terrain.Draw(Matrix.Identity, fpsCam.ViewMatrix, fpsCam.ProjectionMatrix);

            base.Draw(gameTime);
        }
Ejemplo n.º 3
0
        protected override void Draw(GameTime gameTime)
        {
            float lowestHeight  = 0;
            float highestHeight = 30;
            float interp        = (pointerPos.Y - lowestHeight) / (highestHeight - lowestHeight);
            byte  colorValue    = (byte)(255.0f * interp);
            Color clearColor    = new Color(colorValue, colorValue, colorValue);

            device.Clear(ClearOptions.Target | ClearOptions.DepthBuffer, clearColor, 1, 0);

            cCross.Draw(fpsCam.ViewMatrix, fpsCam.ProjectionMatrix);

            //draw terrain
            terrain.Draw(Matrix.Identity, fpsCam.ViewMatrix, fpsCam.ProjectionMatrix);

            spriteBatch.Begin(SpriteBlendMode.AlphaBlend, SpriteSortMode.Deferred, SaveStateMode.SaveState);
            spriteBatch.Draw(crosshair, pointerScreenPos, null, Color.White, 0, new Vector2(7, 7), 1, SpriteEffects.None, 0);
            spriteBatch.End();

            Window.Title = pointerPos.Y.ToString();

            base.Draw(gameTime);
        }