Beispiel #1
0
        // Called when the game should draw itself
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.Black);
            water.PreDraw(camera, gameTime);

            GraphicsDevice.Clear(Color.Black);

            sky.Draw(camera.View, camera.Projection, ((FreeCamera)camera).Position);

            foreach (CModel model in models)
            {
                if (camera.BoundingVolumeIsInView(model.BoundingSphere))
                {
                    model.Draw(camera.View, camera.Projection, ((FreeCamera)camera).Position);
                }
            }

            terrain.Draw(camera.View, camera.Projection, ((FreeCamera)camera).Position);

            water.Draw(camera.View, camera.Projection, ((FreeCamera)camera).Position);

            trees.Draw(camera.View, camera.Projection, ((FreeCamera)camera).Up,
                       ((FreeCamera)camera).Right);

            grass.Draw(camera.View, camera.Projection, ((FreeCamera)camera).Up,
                       ((FreeCamera)camera).Right);

            clouds.Draw(camera.View, camera.Projection, ((FreeCamera)camera).Up,
                        ((FreeCamera)camera).Right);

            base.Draw(gameTime);
        }
Beispiel #2
0
        // Called when the game should draw itself
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.CornflowerBlue);

            sky.Draw(camera.View, camera.Projection, ((FreeCamera)camera).Position);

            foreach (CModel model in models)
            {
                if (camera.BoundingVolumeIsInView(model.BoundingSphere))
                {
                    model.Draw(camera.View, camera.Projection, ((FreeCamera)camera).Position);
                }
            }

            base.Draw(gameTime);
        }