コード例 #1
0
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.DarkGray);
            var cameraPosition = new Vector3(0, 0, 2.5f);
            var aspect         = GraphicsDevice.Viewport.AspectRatio;

            var view       = Matrix.CreateLookAt(cameraPosition, Vector3.Zero, Vector3.Up);
            var projection = Matrix.CreatePerspectiveFieldOfView(1, aspect, 1, 1000);

            _renderer.Draw(view, projection);

            _spriteBatch.Begin();
            Profiler.DrawStats(_spriteBatch, _spriteFont);
            _spriteBatch.End();

            Profiler.Clear();

            base.Draw(gameTime);
        }
コード例 #2
0
ファイル: Primitives3DGame.cs プロジェクト: lm165678/c4g
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.CornflowerBlue);

            var cameraPosition = new Vector3(0, 0, 2.5f);
            var aspect         = GraphicsDevice.Viewport.AspectRatio;

            var view       = Matrix.CreateLookAt(cameraPosition, Vector3.Zero, Vector3.Up);
            var projection = Matrix.CreatePerspectiveFieldOfView(1, aspect, 1, 1000);

            _renderer.Draw(view, projection);

            // Reset the fill mode renderstate.
            GraphicsDevice.RasterizerState = RasterizerState.CullCounterClockwise;

            _spriteBatch.Begin();
            Profiler.DrawStats(_spriteBatch, _spriteFont);
            _spriteBatch.End();

            Profiler.Clear();

            base.Draw(gameTime);
        }