Пример #1
0
        protected override void OnPostRender()
        {
            Camera cam = Camera.current;

            if (cam == null)
            {
                return;
            }

            DrawLines.LineMode       = LINE_MODE.LINES;
            DrawVertices.Orientation = DRAW_ORIENTATION.XY;
            Matrix4x4f m = Matrix4x4f.Identity;

            if (!MadePolygon)
            {
                base.OnPostRender();
            }
            else
            {
                DrawPolygon(cam, polygon, Color.green, Color.yellow);

                if (line != null)
                {
                    DrawLines.Draw(cam, line.Positions, Color.blue, m, line.Indices);
                    DrawVertices.Draw(cam, 0.02f, line.Positions, Color.yellow, m);
                }
            }
        }
Пример #2
0
        protected virtual void OnPostRender()
        {
            Camera cam = Camera.current;

            if (cam == null)
            {
                return;
            }
            if (Points == null)
            {
                return;
            }
            if (Indices == null)
            {
                return;
            }

            Matrix4x4f m = Matrix4x4f.Identity;

            DrawLines.LineMode       = LINE_MODE.LINES;
            DrawVertices.Orientation = DRAW_ORIENTATION.XY;

            DrawLines.Draw(cam, Points, LineColor, m, Indices);
            DrawVertices.Draw(cam, 0.02f, Points, Color.yellow, m);
        }
        private void OnPostRender()
        {
            Camera cam = Camera.current;

            if (cam == null)
            {
                return;
            }

            DrawLines.LineMode   = LINE_MODE.TRIANGLES;
            DrawBase.Orientation = DRAW_ORIENTATION.XY;
            Matrix4x4f m = Matrix4x4f.Identity;

            DrawLines.Draw(cam, mesh.Positions, Color.green, m, mesh.Indices);
            DrawVertices.Draw(cam, 0.02f, mesh.Positions, Color.yellow, m);
        }
Пример #4
0
        private void OnPostRender()
        {
            Camera cam = Camera.current;

            if (cam == null)
            {
                return;
            }

            Matrix4x4f m = Matrix4x4f.Identity;

            DrawLines.LineMode = LINE_MODE.LINES;
            DrawLines.Draw(cam, convex.Positions, Color.red, m, convex.Indices);

            DrawVertices.Orientation = DRAW_ORIENTATION.XY;
            DrawVertices.Draw(cam, 0.02f, points, Color.yellow, m);
        }
Пример #5
0
        protected void DrawPolygon(Camera cam, Polygon2f polygon, Color lineColor, Color vertColor, Matrix4x4f m)
        {
            if (polygon == null)
            {
                return;
            }

            DrawLines.LineMode       = LINE_MODE.LINES;
            DrawVertices.Orientation = DRAW_ORIENTATION.XY;

            DrawLines.Draw(cam, polygon.Positions, lineColor, m, polygon.Indices);
            DrawVertices.Draw(cam, 0.02f, polygon.Positions, vertColor, m);

            if (!polygon.HasHoles)
            {
                return;
            }

            foreach (var hole in polygon.Holes)
            {
                DrawLines.Draw(cam, hole.Positions, lineColor, m, hole.Indices);
                DrawVertices.Draw(cam, 0.02f, hole.Positions, vertColor, m);
            }
        }