Beispiel #1
0
        public void initializeEnviroment()
        {
            //Acceso a Device de DirectX.
            Microsoft.DirectX.Direct3D.Device d3dDevice = GuiController.Instance.D3dDevice;
            totalTime = 0;

            //OCEAN
            ocean = new TgcEditableLand();
            ocean.setTexture(TgcTexture.createTexture(GuiController.Instance.AlumnoEjemplosMediaDir + "Textures\\environment\\water_texture.jpg"));
            ocean.Position = oceanPosition;
            ocean.Scale    = new Vector3(20, 20, 20);


            //SUN
            sun        = new TgcSphere();
            sun.Radius = 20;
            sun.setColor(Color.Yellow);
            sun.setTexture(TgcTexture.createTexture(d3dDevice, GuiController.Instance.AlumnoEjemplosMediaDir + "Textures\\environment\\sun.jpg"));
            sun.Position      = new Vector3(0, 300, 0);
            sun.LevelOfDetail = 4;
            sun.updateValues();

            //SKY
            TgcTexture skyTexture = TgcTexture.createTexture(d3dDevice, GuiController.Instance.AlumnoEjemplosMediaDir + "Textures\\environment\\sky_patten.jpg");

            skyBox        = new TgcSphere();
            skyBox.Radius = (int)GuiController.Instance.Modifiers["skyRadius"];
            skyBox.setTexture(skyTexture);
            skyBox.Position      = (Vector3)GuiController.Instance.Modifiers["skyPosition"];
            skyBox.LevelOfDetail = 4;
            skyBox.updateValues();
        }
Beispiel #2
0
        public override void init()
        {
            Device d3dDevice = GuiController.Instance.D3dDevice;

            //Crear Land
            land = new TgcEditableLand();
            land.setTexture(TgcTexture.createTexture(GuiController.Instance.ExamplesMediaDir + "MeshCreator\\Textures\\Vegetacion\\blackrock_3.jpg"));

            //Modifiers para configurar altura
            GuiController.Instance.Modifiers.addInterval("vertices", new string[] { "CENTER", "INTERIOR_RING", "EXTERIOR_RING", "TOP_SIDE", "LEFT_SIDE", "RIGHT_SIDE", "BOTTOM_SIDE" }, 0);
            GuiController.Instance.Modifiers.addFloat("height", -50, 50, 0);
            GuiController.Instance.Modifiers.addVertex2f("offset", new Vector2(-0.5f, -0.5f), new Vector2(0.9f, 0.9f), new Vector2(0, 0));
            GuiController.Instance.Modifiers.addVertex2f("tiling", new Vector2(0.1f, 0.1f), new Vector2(4, 4), new Vector2(1, 1));

            GuiController.Instance.RotCamera.targetObject(land.BoundingBox);
        }
Beispiel #3
0
        public override void Init()
        {
            //Crear Land
            land = new TgcEditableLand();
            land.setTexture(
                TgcTexture.createTexture(MediaDir + "MeshCreator\\Textures\\Vegetacion\\blackrock_3.jpg"));

            //Modifiers para configurar altura
            Modifiers.addInterval("vertices",
                                  new[] { "CENTER", "INTERIOR_RING", "EXTERIOR_RING", "TOP_SIDE", "LEFT_SIDE", "RIGHT_SIDE", "BOTTOM_SIDE" },
                                  0);
            Modifiers.addFloat("height", -50, 50, 0);
            Modifiers.addVertex2f("offset", new Vector2(-0.5f, -0.5f), new Vector2(0.9f, 0.9f), new Vector2(0, 0));
            Modifiers.addVertex2f("tiling", new Vector2(0.1f, 0.1f), new Vector2(4, 4), new Vector2(1, 1));

            Camara = new TgcRotationalCamera(new Vector3(40f, 40f, 40f), 150f);
        }