コード例 #1
0
        public Planet(GraphicsDevice GraphicsDevice, ContentManager Content, bool water)
        {
            this.isWater = true;
            Effect effect = Content.Load<Effect>(@"effects/PPModel");
            Texture2D texture = Content.Load<Texture2D>(@"textures/red");

            Vector3 pos = Vector3.Zero;
            top = new Terrain(4096, HeightMag + WaterLevel, 1f, 65, pos, effect, texture, Terrain.Type.WaterCubeFace);
            top.GenerateEmptySlice();

            left = new Terrain(4096, HeightMag + WaterLevel, 1f, 65, pos, effect, texture, Terrain.Type.WaterCubeFace);
            left.GenerateEmptySlice(new Vector3(0, 0, 90));

            right = new Terrain(4096, HeightMag + WaterLevel, 1f, 65, pos, effect, texture, Terrain.Type.WaterCubeFace);
            right.GenerateEmptySlice(new Vector3(0, 0, -90));

            front = new Terrain(4096, HeightMag + WaterLevel, 1f, 65, pos, effect, texture, Terrain.Type.WaterCubeFace);
            front.GenerateEmptySlice(new Vector3(90, 0, 0));

            back = new Terrain(4096, HeightMag + WaterLevel, 1f, 65, pos, effect, texture, Terrain.Type.WaterCubeFace);
            back.GenerateEmptySlice(new Vector3(-90, 0, 0));

            bottom = new Terrain(4096, HeightMag + WaterLevel, 1f, 65, pos, effect, texture, Terrain.Type.WaterCubeFace);
            bottom.GenerateEmptySlice(new Vector3(180, 0, 0));
        }
コード例 #2
0
        public Planet(GraphicsDevice GraphicsDevice, ContentManager Content, bool water, Vector3 sunPosition)
        {
            this.isWater = true;

            Vector3 pos = Vector3.Zero;
            top = new Terrain(4096, HeightMag, 1f, 65, pos, new Vector3(1, -1, 0), GraphicsDevice, Content.Load<Effect>(@"effects/Terrain"), Content.Load<Texture2D>(@"textures/red"), Terrain.Type.WaterCubeFace);
            top.GenerateEmptySlice();

            left = new Terrain(4096, HeightMag, 1f, 65, pos, new Vector3(1, -1, 0), GraphicsDevice, Content.Load<Effect>(@"effects/Terrain"), Content.Load<Texture2D>(@"textures/red"), Terrain.Type.WaterCubeFace);
            left.GenerateEmptySlice(new Vector3(0, 0, 90));

            right = new Terrain(4096, HeightMag, 1f, 65, pos, new Vector3(1, -1, 0), GraphicsDevice, Content.Load<Effect>(@"effects/Terrain"), Content.Load<Texture2D>(@"textures/red"), Terrain.Type.WaterCubeFace);
            right.GenerateEmptySlice(new Vector3(0, 0, -90));

            front = new Terrain(4096, HeightMag, 1f, 65, pos, new Vector3(1, -1, 0), GraphicsDevice, Content.Load<Effect>(@"effects/Terrain"), Content.Load<Texture2D>(@"textures/red"), Terrain.Type.WaterCubeFace);
            front.GenerateEmptySlice(new Vector3(90, 0, 0));

            back = new Terrain(4096, HeightMag, 1f, 65, pos, new Vector3(1, -1, 0), GraphicsDevice, Content.Load<Effect>(@"effects/Terrain"), Content.Load<Texture2D>(@"textures/red"), Terrain.Type.WaterCubeFace);
            back.GenerateEmptySlice(new Vector3(-90, 0, 0));

            bottom = new Terrain(4096, HeightMag, 1f, 65, pos, new Vector3(1, -1, 0), GraphicsDevice, Content.Load<Effect>(@"effects/Terrain"), Content.Load<Texture2D>(@"textures/red"), Terrain.Type.WaterCubeFace);
            bottom.GenerateEmptySlice(new Vector3(180, 0, 0));

            top.LightPosition = sunPosition;
            left.LightPosition = sunPosition;
            right.LightPosition = sunPosition;
            front.LightPosition = sunPosition;
            back.LightPosition = sunPosition;
            bottom.LightPosition = sunPosition;
        }