Ejemplo n.º 1
0
        /// <summary>
        /// Draw method for the entire skybox
        /// </summary>
        /// <param name="gt">The game time</param>
        /// <param name="cam">The camera class</param>
        /// <param name="playerPos">The players position</param>
        public void Draw(Matrix v, Matrix Projection, GraphicsDevice gd)
        {
            Matrix worldMatrix = Matrix.Identity;

            e.Begin();
            e.Techniques[0].Passes[0].Begin();

            world.SetValue(worldMatrix);
            view.SetValue(v);
            projection.SetValue(Projection);
            diffuseTex.SetValue(text);

            e.CommitChanges();

            gd.RenderState.CullMode = CullMode.None;
            gd.RenderState.DepthBufferWriteEnable = false;

            sphere.draw(gd);

            gd.RenderState.DepthBufferWriteEnable = true;
            gd.RenderState.CullMode = CullMode.CullCounterClockwiseFace;

            e.Techniques[0].Passes[0].End();
            e.End();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Draw method for the entire skybox
        /// </summary>
        /// <param name="gt">The game time</param>
        /// <param name="cam">The camera class</param>
        /// <param name="playerPos">The players position</param>
        public void Draw(GameTime gt, Camera.CameraMatrices cam)
        {
            Matrix worldMatrix = Matrix.Identity;

            e.Begin();
            e.Techniques[0].Passes[0].Begin();

            world.SetValue(worldMatrix);
            view.SetValue(cam.View);
            projection.SetValue(cam.Projection);
            diffuseTex.SetValue(text);

            e.CommitChanges();

            GraphicsDevice.RenderState.CullMode = CullMode.None;
            GraphicsDevice.RenderState.DepthBufferWriteEnable = false;

            cube.draw(GraphicsDevice, cam);

            GraphicsDevice.RenderState.DepthBufferWriteEnable = true;
            GraphicsDevice.RenderState.CullMode = CullMode.CullCounterClockwiseFace;

            e.Techniques[0].Passes[0].End();
            e.End();
        }