private void Start()
    {
        data = new Vector3[sampleSize];

        for (int i = 0; i < data.Length; i++)
        {
            float x = Random.Range(-1f, 1f);
            float y = Random.Range(-1f, 1f);
            float z = Random.Range(-1f, 1f);
            data[i] = new Vector3(x, y, z) * spaceSize;
        }

        result = KMeans.Cluster(data, clustersCount, iterations, 0);
    }
Пример #2
0
    private void Start()
    {
        data = new Bounds[sampleSize];

        for (int i = 0; i < data.Length; i++)
        {
            float x  = Random.Range(-1f, 1f);
            float y  = Random.Range(-1f, 1f);
            float z  = Random.Range(-1f, 1f);
            float sx = Random.Range(0.1f, boxMaxSize);
            float sy = Random.Range(0.1f, boxMaxSize);
            float sz = Random.Range(0.1f, boxMaxSize);
            data[i] = new Bounds(new Vector3(x, y, z) * spaceSize, new Vector3(sx, sy, sz));
        }

        result = KMeans.Cluster(data, clustersCount, iterations, 0);
    }
Пример #3
0
 public void compute()
 {
     result = KMeans.Cluster(data, clustersCount, iterations, 0);
 }