public void Crear() { contenedorModelo = ContentManager.GetModelByName("carro.3DS"); contenedorModelo.CreateDisplayList(); contenedorModelo.ScaleX = 0.1f; contenedorModelo.ScaleY = 0.1f; contenedorModelo.ScaleZ = 0.1f; foreach (var item in contenedorModelo.GetMeshes) { item.CalcCenterPoint(); switch (item.Name) { case "rim": llantas.Add(item); break; case "body": chasis = item; break; } } textura = ContentManager.GetTextureByName("chasis" + color.Name + ".jpg"); }
public void Create() { m = ContentManager.GetModelByName("casa.3DS"); m.CreateDisplayList(); aspa = m.GetMeshWithName("ventilado0"); frame = m.GetMeshWithName("magela"); aspa.CalcCenterPoint(); // calculo el punto medio de objeto m.RemoveMeshByName("ventilado0"); //quita el mesh m.RemoveMeshByName("magela"); //quita el mesh }
public void Create() { m = ContentManager.GetModelByName("carro.3DS"); m.CreateDisplayList(); //optimice the model and load it in opengl display lists m.ScaleX = 0.1f; m.ScaleY = 0.1f; m.ScaleZ = 0.1f; foreach (var item in m.GetMeshes) { item.CalcCenterPoint();// calculate th epivot point switch (item.Name) { case "tireA": case "tireB": case "tireC": case "tire": case "rimA": case "rimB": case "rimC": case "rim": tires.Add(item); break; case "body": body = item; break; } } if (color == Color.Blue) { texture = ContentManager.GetTextureByName("bodyBlue.jpg"); } if (color == Color.Red) { texture = ContentManager.GetTextureByName("bodyRed.jpg"); } if (color == Color.Green) { texture = ContentManager.GetTextureByName("bodyGreen.jpg"); } if (color == Color.Violet) { texture = ContentManager.GetTextureByName("bodyViolet.jpg"); m.RemoveMeshesWithName("body"); m.RemoveMeshesWithName("tire"); m.RemoveMeshesWithName("rim"); } }
public void Create() { m = ContentManager.GetModelByName("nave.3DS"); m.CreateDisplayList(); }
public void Create() { m = ContentManager.GetModelByName("torno.3DS"); barrena = m.GetMeshWithName("barrena"); platoAutoCentrante = m.GetMeshWithName("platoautoc"); portaCuchilla = m.GetMeshWithName("portatorni"); baseTorno = m.GetMeshWithName("basetorno"); cuchilla = m.GetMeshWithName("cuchilla"); //botones botonAlta = m.GetMeshWithName("boton1base"); botonBaja = m.GetMeshWithName("boton2base"); botonEncender = m.GetMeshWithName("boton3base"); //todos los meshes del carro baseCarro = m.GetMeshWithName("basecarro"); manivela2c = m.GetMeshWithName("manivela2c"); manibela1c = m.GetMeshWithName("manibela1c"); manivela5c = m.GetMeshWithName("manivela5c"); base1 = m.GetMeshWithName("base1"); base2 = m.GetMeshWithName("base2"); base3 = m.GetMeshWithName("base3"); base4 = m.GetMeshWithName("base3"); base5 = m.GetMeshWithName("base3"); rueda1carro = m.GetMeshWithName("rueda1carr"); rueda2carro = m.GetMeshWithName("rueda2carr"); baseBotones = m.GetMeshWithName("basebotone"); boton1Carro = m.GetMeshWithName("boton1carr"); boton2Carro = m.GetMeshWithName("boton2carr"); manivela3c = m.GetMeshWithName("manivela3c"); manivela6c = m.GetMeshWithName("manivela6c"); manivela4c = m.GetMeshWithName("manivela6c"); for (int i = 0; i < 8; i++) { tornillos.Add(m.GetMeshWithName("tornillo" + (i + 1).ToString())); } Mesh manivela3b = m.GetMeshWithName("manivela3b"); Mesh manivela4b = m.GetMeshWithName("manivela4b"); Mesh manivela5b = m.GetMeshWithName("manivela5b"); Mesh manivela6b = m.GetMeshWithName("manivela6b"); Mesh control1ba = m.GetMeshWithName("control1ba"); Mesh manivela1b = m.GetMeshWithName("manivela1b"); Mesh manivela2b = m.GetMeshWithName("manivela2b"); Mesh cilindro1 = m.GetMeshWithName("ciliindro1"); Mesh cilindro2 = m.GetMeshWithName("cilindro2"); Mesh cilindro3 = m.GetMeshWithName("cilindro3"); Mesh palancacil = m.GetMeshWithName("palancacil"); Mesh palancacar = m.GetMeshWithName("palancacar"); Mesh contrapunta = m.GetMeshWithName("contrapunt"); Mesh manivela1c = m.GetMeshWithName("manivela1c"); Mesh rueda1cont = m.GetMeshWithName("rueda1cont"); Mesh correcuchilla = m.GetMeshWithName("correcuhch"); manivela3b.Description = "Palanca para el movimiento de traslación automatico del brazo"; manivela4b.Description = manivela3b.Description; manivela5b.Description = manivela3b.Description; manivela6b.Description = manivela3b.Description; control1ba.Description = "Palanca para el ajuste de la velocidad del plato autocentrante"; manivela1b.Description = control1ba.Description; manivela2b.Description = control1ba.Description; cilindro1.Description = "Barra de roscar"; cilindro2.Description = "Barra de cilindrar"; cilindro3.Description = "Barra de accionar el plato autocentrante"; palancacil.Description = "Palanca para accionar la barra que acciona el plato autocentrante"; palancacar.Description = palancacil.Description; barrena.Description = "Barrena"; platoAutoCentrante.Description = "Plato autocentrante"; portaCuchilla.Description = "Porta cuchilla"; baseTorno.Description = "Base del torno"; cuchilla.Description = "Cuchilla"; botonAlta.Description = "Boton de alta revolucion"; botonBaja.Description = "Boton de baja revolucion"; botonEncender.Description = "Boton de encendido"; baseCarro.Description = "Delantar"; manibela1c.Description = "Manivela de movimiento longitudinal manual"; rueda1carro.Description = "Manivela de movimiento transversal mannual"; boton1Carro.Description = "Boton para el movimiento de forma rapida del delantar con el portacuchillas longitudinal"; boton2Carro.Description = "Boton para el movimiento de forma rapida del delantar con el portacuchillas transversal"; manivela5c.Description = "Manivela que permite unir el delantar con la barra de roscar"; manivela6c.Description = "Selector de movimiento automatico"; contrapunta.Description = "Cabezal móvil o contrapunta"; manivela1c.Description = "Manivela para frenar el movimiento del husillo de la contrapunta"; rueda1cont.Description = "Manivela para el movimiento longitudinal del husillo de la contrapunta"; correcuchilla.Description = "Guias del torno"; //manivelas targets.Add(manivela3b); targets.Add(manivela4b); targets.Add(manivela5b); targets.Add(manivela6b); targets.Add(control1ba); targets.Add(manivela1b); targets.Add(manivela2b); //barras targets.Add(cilindro1); targets.Add(cilindro2); targets.Add(cilindro3); targets.Add(palancacil); targets.Add(palancacar); //targets.Add(barrena); targets.Add(platoAutoCentrante); targets.Add(portaCuchilla); targets.Add(baseTorno); targets.Add(cuchilla); //botones targets.Add(botonAlta); targets.Add(botonBaja); targets.Add(botonEncender); targets.Add(baseCarro); targets.Add(manibela1c); targets.Add(rueda1carro); targets.Add(boton1Carro); targets.Add(boton2Carro); targets.Add(manivela5c); targets.Add(manivela6c); targets.Add(contrapunta); targets.Add(manivela1c); targets.Add(rueda1cont); targets.Add(correcuchilla); platoAutoCentrante.CalcCenterPoint(); cuchilla.CalcCenterPoint(); cuchillaPos1 = cuchilla.CenterPoint; // -0.74 12.11 2.37 // la possion deseada no es el centro sino el borde de la cuchilla // por eso le suma los siguientes numeros cuchillaPos1.Z -= 0.51f; cuchillaPos1.X += 0.05f; cuchillaPos2 = new Vector3(cuchillaPos1); cuchillaPos2.Z -= 0.05f; cuchillaPos2.X -= 0.05f; baseTornoPos.Translate(new Vector3(0, 0, 1.81f)); cuchillaPos1.Translate(new Vector3(0, 0, 1.81f)); cuchillaPos2.Translate(new Vector3(0, 0, 1.81f)); m.RemoveMeshByName("barrena"); m.RemoveMeshByName("platoautoc"); m.RemoveMeshByName("portatorni"); m.RemoveMeshByName("cuchilla"); m.RemoveMeshByName("boton1base"); m.RemoveMeshByName("boton2base"); m.RemoveMeshByName("boton3base"); for (int i = 0; i < 8; i++) { m.RemoveMeshByName("tornillo" + (i + 1).ToString()); } m.RemoveMeshByName("manivela2c"); m.RemoveMeshByName("manibela1c"); m.RemoveMeshByName("manivela5c"); m.RemoveMeshByName("base1"); m.RemoveMeshByName("base2"); m.RemoveMeshByName("base3"); m.RemoveMeshByName("base4"); m.RemoveMeshByName("base5"); m.RemoveMeshByName("basecarro"); m.RemoveMeshByName("rueda1carr"); m.RemoveMeshByName("rueda2carr"); m.RemoveMeshByName("basebotone"); m.RemoveMeshByName("boton1carr"); m.RemoveMeshByName("boton2carr"); m.RemoveMeshByName("manivela3c"); m.RemoveMeshByName("manivela6c"); m.RemoveMeshByName("manivela4c"); m.CreateDisplayList(); }
static void Load3dsModels() { airplaneModel = ContentManager.GetModelByName("airplane.3ds"); airplaneModel.CreateDisplayList(); }
ModelContainer m; // este es el que contiene el modelo public void Create() { m = ContentManager.GetModelByName("recortadora.3DS"); m.CreateDisplayList(); // optimiza el modelo }