public Engine3d() { m_lines = new List<PolyLine3d>(); m_objects = new List<Object3d>(); m_alpha = false; m_axisInd = new AxisIndicator(); m_axisInd.Create(14, 0.5f, 3, 5, 1.2f); //AddGrid(); // grid actually was created twice. -SHS }
public Engine3d() { m_lines = new List <PolyLine3d>(); m_objects = new List <Object3d>(); m_alpha = false; m_axisInd = new AxisIndicator(); m_axisInd.Create(14, 0.5f, 3, 5, 1.2f); //AddGrid(); // grid actually was created twice. -SHS }
public void UpdateGrid() { if (m_axisInd == null) { m_axisInd = new AxisIndicator(); m_axisInd.Create(15, 0.3f, 1, 1, .00002f); } m_lines = new List <PolyLine3d>(); AddGrid(); AddPlatCube(); AddPlatWalls(); }
public void RenderGL(bool alpha) { UpdateWallVisibility(); try { GL.Enable(EnableCap.Lighting); GL.Enable(EnableCap.Light0); GL.Disable(EnableCap.LineSmooth); if (UVDLPApp.Instance().m_appconfig.m_viewslice3d&& UVDLPApp.Instance().m_appconfig.m_hideaboveslice&& m_clipHeight >= 0) { GL.Disable(EnableCap.CullFace); GL.Enable(EnableCap.ClipPlane0); GL.ClipPlane(ClipPlaneName.ClipPlane0, new double[] { 0, 0, -1, m_clipHeight }); } foreach (Object3d obj in m_objects) { obj.m_axis = null; Color objColor = m_objectColor; if (UVDLPApp.Instance().m_appconfig.m_showShaded) { if (UVDLPApp.Instance().SelectedObject == obj) { objColor = m_selectColor; } else if (obj.m_inSelectedList) { objColor = m_multiselColor; } } if (UVDLPApp.Instance().SelectedObject == obj) { obj.RenderGL(alpha, true, UVDLPApp.Instance().m_appconfig.m_showOutline, objColor); m_axisIndBase = new AxisIndicator(); var max = Math.Max(obj.m_radius / 5, 5); m_axisIndBase.Create(obj.m_radius, 1f, 5, 5, 5); m_axisIndBase.RenderGL(obj.m_center); obj.m_axis = m_axisIndBase; } else { obj.RenderGL(alpha, false, UVDLPApp.Instance().m_appconfig.m_showOutline, objColor); } } GL.Enable(EnableCap.CullFace); GL.Disable(EnableCap.ClipPlane0); GL.Disable(EnableCap.Lighting); GL.Disable(EnableCap.Light0); GL.Enable(EnableCap.LineSmooth); GL.LineWidth(1); foreach (PolyLine3d ply in m_lines) { ply.RenderGL(); } // render selection bounding box if (UVDLPApp.Instance().m_appconfig.m_showBoundingBox&& (UVDLPApp.Instance().SelectedObjectList != null)) { GL.LineWidth(2); Color clr = Color.FromArgb(255, 1, 142, 149); foreach (Object3d obj in UVDLPApp.Instance().SelectedObjectList) { obj.RenderBoundingBox(clr); clr = Color.Orange; } } // render walls if object is out of platform // GL.CullFace(CullFaceMode.Back); // specify culling backfaces GL.CullFace(CullFaceMode.Front); // specify culling backfaces foreach (Quad3d q in m_walls) { if (q.visible) { q.RenderGL(); } } GL.CullFace(CullFaceMode.Back); // specify culling backfaces foreach (Quad3d q in m_walls) { if (q.visible) { q.RenderGL(); } } if (RTUtils.m_selplane != null) { // RTUtils.m_selplane.RenderGL(true, false, false, Color.Cornsilk); } } catch (Exception ex) { DebugLogger.Instance().LogError(ex); } }