public Chispa() { TgcSceneLoader loader = new TgcSceneLoader(); mesh = loader.loadSceneFromFile(sphere).Meshes[0]; mesh.changeDiffuseMaps(new TgcTexture[] { TgcTexture.createTexture(d3dDevice, Shared.mediaPath + "\\otros\\giallo.png") }); mesh.Scale = new Vector3(0.08f, 0.08f, 0.08f); }
public override void init() { Device d3dDevice = GuiController.Instance.D3dDevice; string sphere = GuiController.Instance.ExamplesMediaDir + "ModelosTgc\\Sphere\\Sphere-TgcScene.xml"; TgcSceneLoader loader = new TgcSceneLoader(); //Cargar modelos para el sol, la tierra y la luna. Son esfereas a las cuales le cambiamos la textura sun = loader.loadSceneFromFile(sphere).Meshes[0]; sun.changeDiffuseMaps(new TgcTexture[] { TgcTexture.createTexture(d3dDevice, GuiController.Instance.ExamplesDir + "Transformations\\SistemaSolar\\SunTexture.jpg") }); earth = loader.loadSceneFromFile(sphere).Meshes[0]; earth.changeDiffuseMaps(new TgcTexture[] { TgcTexture.createTexture(d3dDevice, GuiController.Instance.ExamplesDir + "Transformations\\SistemaSolar\\EarthTexture.jpg") }); moon = loader.loadSceneFromFile(sphere).Meshes[0]; moon.changeDiffuseMaps(new TgcTexture[] { TgcTexture.createTexture(d3dDevice, GuiController.Instance.ExamplesDir + "Transformations\\SistemaSolar\\MoonTexture.jpg") }); //Deshabilitamos el manejo automático de Transformaciones de TgcMesh, para poder manipularlas en forma customizada sun.AutoTransformEnable = false; earth.AutoTransformEnable = false; moon.AutoTransformEnable = false; //Color de fondo GuiController.Instance.BackgroundColor = Color.Black; //Camara en primera persona GuiController.Instance.FpsCamera.Enable = true; GuiController.Instance.FpsCamera.setCamera(new Vector3(705.2938f, 305.347f, -888.1567f), new Vector3(183.6915f, 19.6596f, -84.2204f)); }
public void crearEsferaExplosion() { TgcSceneLoader loaderExplosion = new TgcSceneLoader(); esferaExplosion = loaderExplosion.loadSceneFromFile(GuiController.Instance.AlumnoEjemplosMediaDir + "\\Sphere\\Sphere-TgcScene.xml").Meshes[0]; esferaExplosion.changeDiffuseMaps(new TgcTexture[] { TgcTexture.createTexture(d3dDevice, GuiController.Instance.AlumnoEjemplosMediaDir + "\\explosion.jpg") }); }