Exemple #1
0
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);
            GameObject terrainObject = new GameObject();

            terrainObject.Transform.LocalScale *= new Vector3(1, 5, 1);
            terrain = terrainObject.Add <TerrainRenderer>();
            terrain.Initialize(
                Content.Load <Texture2D>("Textures/Heightmap"),
                Vector2.One * 100, Vector2.One * 200);
            terrain.NormalMap = Content.Load <Texture2D>("Textures/Normalmap");
            effect            = Content.Load <Effect>("Effects/TerrainShader");

            GameObject cameraObject = new GameObject();

            cameraObject.Transform.LocalPosition = Vector3.Backward * 5 + Vector3.Right * 5 + Vector3.Up * 5;
            camera = cameraObject.Add <Camera>();
        }