Beispiel #1
0
    private void OnDrawGizmos()
    {
        //Gizmos.DrawWireSphere(Vector3.zero, area);

        if (points.Count <= 0)
        {
            return;
        }

        //points.bubbleSortX();

        Gizmos.color = Color.red;
        if (convexHull != null)
        {
            convexHull.Draw();
        }


        for (int i = 0; i < points.Count; i++)
        {
            float color = (float)i / (float)points.Count;
            Gizmos.color = pointColor.Evaluate(color);
            Gizmos.DrawSphere(points[i], pointSize);
        }

        Gizmos.color = Color.white;

        if (triangulation != null)
        {
            triangulation.Draw();
        }


        Gizmos.color = Color.red;
        voronoi.Draw();

        //if (voronoi != null && voronoi.points != null)
        //{
        //    for (int i = 0; i < voronoi.points.Count; i++)
        //    {
        //        Gizmos.color = Color.green;
        //        Gizmos.DrawSphere(voronoi.points[i], 10.5f);
        //    }
        //    for (int i = 0; i < voronoi.segments.Count; i++)
        //    {
        //        voronoi.segments[i].Draw();
        //    }
        //}
    }