public void PlaceObjectOnFloor(int selected_model_index) { if (ModelList.Count <= 0 || selected_model_index < 0) { return; } ModelTransformPair model = ModelList[selected_model_index]; var vector3 = new M3D.Model.Utils.Vector3(0.0f, 0.0f, (float)(-model.modelSize.Min.Z + 1.0)); model.transformNode.Translation.Z += vector3.Z; model.CalculateExtents(); }
public int AddModel(Graphics.Ext3D.ModelRendering.Model model, out ModelTransformPair modtrans_pair) { modtrans_pair = new ModelTransformPair { modelNode = new Model3DNode(3200) }; modtrans_pair.modelNode.SetModel(model); modtrans_pair.modelNode.Ambient = new Color4(modelColor.R / 4f, modelColor.G / 4f, modelColor.B / 4f, 1f); modtrans_pair.modelNode.Diffuse = modelColor; modtrans_pair.modelNode.Specular = new Color4(0.5f, 0.5f, 0.5f, 1f); modtrans_pair.modelNode.Shininess = 100f; modtrans_pair.transformNode = new TransformationNode(3100, ObjectToPrinterSpace); modtrans_pair.transformNode.AddChildElement(modtrans_pair.modelNode); modtrans_pair.CalculateExtents(); ObjectToPrinterSpace.AddChildElement(modtrans_pair.transformNode); ModelList.Add(modtrans_pair); return(ModelList.Count - 1); }