示例#1
0
        // Called when the game should load its content
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);

            models.Add(new CModel(Content.Load <Model>("Content/teapot__cv1"),
                                  Vector3.Zero, Vector3.Zero, Vector3.One * 50, GraphicsDevice));

            Effect cubeMapEffect           = Content.Load <Effect>("Content/CubeMapReflect");
            CubeMapReflectMaterial cubeMat = new CubeMapReflectMaterial(
                Content.Load <TextureCube>("Content/clouds"));

            models[0].SetModelEffect(cubeMapEffect, false);
            models[0].Material = cubeMat;

            Plane clip = new Plane(Vector3.Up, 0);

            sky = new SkySphere(Content, GraphicsDevice,
                                Content.Load <TextureCube>("Content/clouds"));

            water = new Water(Content, GraphicsDevice, Vector3.Zero, new Vector2(8000, 8000));

            water.Objects.Add(sky);
            water.Objects.Add(models[0]);
            //water.Objects.Add(models[1]);

            camera = new FreeCamera(new Vector3(0, 400, 1400),
                                    MathHelper.ToRadians(0),
                                    MathHelper.ToRadians(0),
                                    GraphicsDevice);

            lastMouseState = Mouse.GetState();
        }
示例#2
0
        // Called when the game should load its content
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);

            models.Add(new CModel(Content.Load <Model>("teapot"),
                                  Vector3.Zero, Vector3.Zero, Vector3.One * 50, GraphicsDevice));

            Effect cubeMapEffect           = Content.Load <Effect>("CubeMapReflect");
            CubeMapReflectMaterial cubeMat = new CubeMapReflectMaterial(
                Content.Load <TextureCube>("clouds"));

            models[0].SetModelEffect(cubeMapEffect, true);
            models[0].Material = cubeMat;

            sky = new SkySphere(Content, GraphicsDevice,
                                Content.Load <TextureCube>("clouds"));

            camera = new FreeCamera(new Vector3(0, 400, 1400),
                                    MathHelper.ToRadians(0),
                                    MathHelper.ToRadians(0),
                                    GraphicsDevice);

            lastMouseState = Mouse.GetState();
        }