Example #1
0
 private void setDistanciaFrustum(float _distanciaFarPlane)
 {
     TgcD3dDevice.zFarPlaneDistance = _distanciaFarPlane;
     TgcD3dDevice tgcD3dDevice = new TgcD3dDevice(GuiController.Instance.Panel3d);
     tgcD3dDevice.OnResetDevice(tgcD3dDevice.D3dDevice, null);
 }
Example #2
0
        /// <summary>
        /// Crea todos los modulos necesarios de la aplicacion
        /// </summary>
        internal void initGraphics(MainForm mainForm, Control panel3d)
        {
            this.mainForm = mainForm;
            this.panel3d = panel3d;
            this.fullScreenPanel = new FullScreenPanel();
            panel3d.Focus();

            //Iniciar graficos
            this.tgcD3dDevice = new TgcD3dDevice(panel3d);
            this.texturesManager = new TgcTexture.Manager();
            this.tgcD3dDevice.OnResetDevice(tgcD3dDevice.D3dDevice, null);

            //Iniciar otras herramientas
            this.texturesPool = new TgcTexture.Pool();
            this.logger = new Logger(mainForm.LogConsole);
            this.text3d = new TgcDrawText(tgcD3dDevice.D3dDevice);
            this.tgcD3dInput = new TgcD3dInput(mainForm, panel3d);
            this.fpsCamera = new TgcFpsCamera();
            this.rotCamera = new TgcRotationalCamera();
            this.thirdPersonCamera = new TgcThirdPersonCamera();
            this.axisLines = new TgcAxisLines(tgcD3dDevice.D3dDevice);
            this.userVars = new TgcUserVars(mainForm.getDataGridUserVars());
            this.modifiers = new TgcModifiers(mainForm.getModifiersPanel());
            this.elapsedTime = -1;
            this.frustum = new TgcFrustum();
            this.mp3Player = new TgcMp3Player();
            this.directSound = new TgcDirectSound();
            this.fog = new TgcFog();
            this.currentCamera = this.rotCamera;
            this.customRenderEnabled = false;
            this.drawer2D = new TgcDrawer2D();
            this.shaders = new TgcShaders();

            //toogles
            this.rotCamera.Enable = true;
            this.fpsCamera.Enable = false;
            this.thirdPersonCamera.Enable = false;
            this.fpsCounterEnable = true;
            this.axisLines.Enable = true;

            //Cargar algoritmos
            exampleLoader = new ExampleLoader();
            examplesDir = System.Environment.CurrentDirectory + "\\" + ExampleLoader.EXAMPLES_DIR + "\\";
            examplesMediaDir = examplesDir + "Media" + "\\";
            alumnoEjemplosDir = System.Environment.CurrentDirectory + "\\" + "AlumnoEjemplos" + "\\";
            alumnoEjemplosMediaDir = alumnoEjemplosDir + "AlumnoMedia" + "\\";
            exampleLoader.loadExamplesInGui(mainForm.TreeViewExamples, new string[] { examplesDir, alumnoEjemplosDir });

            //Cargar shaders del framework
            this.shaders.loadCommonShaders();

            //Cargar ejemplo default
            TgcExample defaultExample = exampleLoader.getExampleByName(mainForm.Config.defaultExampleName, mainForm.Config.defaultExampleCategory);
            executeExample(defaultExample);
        }