public override void init()
        {


            Microsoft.DirectX.Direct3D.Device d3dDevice = GuiController.Instance.D3dDevice;
            String mediaDir = CommandosUI.Instance.MediaDir;
            Terrain terrain = new Terrain(
                mediaDir+"Heightmaps\\"+"HeightmapParedes.jpg",
                mediaDir + "Heightmaps\\"+"TexturaParedes.jpg",
                10f,
                0.4f);

            nivel = new Level(terrain);
           

            commando = new Commando(terrain.getPosition(200, 200));
            nivel.add(commando);
            commando.Life.Infinite = true;


           
            Vector3[] waitpoints = new Vector3[1];
            terrain.heightmapCoordsToXYZ(new Vector2(60, 60), out waitpoints[0]);
            //terrain.heightmapCoordsToXYZ(new Vector2(22, 80), out waitpoints[1]);
            //terrain.heightmapCoordsToXYZ(new Vector2(10, 37), out waitpoints[2]);

            
            enemigo = new Enemy(new Vector3(0,0,0));
            nivel.add(enemigo);
            

            //Seleccion multiple
            selection = new Selection(nivel.Characters, nivel.Terrain);

            //Movimiento por picking
            picking = new MovementPicking(nivel.Terrain);

            GuiController.Instance.Modifiers.addFloat("RadioVision", 0, 500, 100);
            GuiController.Instance.Modifiers.addFloat("AnguloVision", 0, 90, 45);
            GuiController.Instance.Modifiers.addBoolean("Direccion", "Mostrar", false);
            GuiController.Instance.Modifiers.addVertex3f("posicionEnemigo", new Vector3(-1000, -1000, -1000), new Vector3(1000, 1000, 1000), new Vector3(400, 0, 100));
            GuiController.Instance.Modifiers.addFloat("RotacionEnemigo", 0, 360, 0);



            previousAngle = 0;

            new StandardCamera();
            nivel.CullingEnabled = false;
        }
        public override void init(){
        

            Microsoft.DirectX.Direct3D.Device d3dDevice = GuiController.Instance.D3dDevice;
            String mediaDir = GuiController.Instance.AlumnoEjemplosMediaDir;
            nivel = new Level(
                new Terrain(CommandosUI.Instance.MediaDir + "Heightmaps\\HeightmapPlano.jpg",
                    GuiController.Instance.ExamplesMediaDir + "Texturas\\tierra.jpg",
                    10f,
                    1f
                    )
                 );
            pared = new Wall(new Vector3(0,0,0), new Vector3(200, 50, 10));
                        
            pj = new Commando(new Vector3(0, 0, -40));
            pj.Representation.AutoTransformEnable = true;


            enemigo = new Enemy(new Vector3(0, 0, 40));
            enemigo.ShowConeDirection = true;
            nivel.add(pared);
            nivel.add(enemigo);
            nivel.add(pj);

            GuiController.Instance.Modifiers.addFloat("AlturaPared", 10, 60, 10);
            GuiController.Instance.Modifiers.addFloat("RadioVision", 0, 500,100);
            GuiController.Instance.Modifiers.addFloat("AnguloVision", 0, 90, 45);
            GuiController.Instance.Modifiers.addBoolean("Direccion","Mostrar",false);
            //GuiController.Instance.RotCamera.targetObject(enemigo.BoundingBox);
            GuiController.Instance.RotCamera.CameraDistance = 200;
            GuiController.Instance.Modifiers.addVertex3f("posicionTarget", new Vector3(-100, -100, -100), new Vector3(100, 100, 100), new Vector3(0, 0, -20));

            Modifiers.initialize();


            GuiController.Instance.Modifiers.addBoolean("Cilindros", "Ver cilindros", false);
            Modifiers.Instance.bind("Cilindros", typeof(Character), "RenderCylinder");
            GuiController.Instance.Modifiers.addBoolean("Agachado", "Sí", false);
            Modifiers.Instance.bind("Agachado", this, "Crouch");
            Modifiers.Instance.bind("RadioVision", enemigo,"VisionRadius");
            Modifiers.Instance.bind("Direccion", enemigo, "ShowConeDirection");
            Modifiers.Instance.bind("posicionTarget", pj, "Position");







        }