Exemplo n.º 1
0
    private void Update()
    {
        var += Random.Range(0.05f, 0.2f);
        MeshFilter meshFilter = this.GetComponent <MeshFilter>();

        mg.Clear();
        int cnt = 0;

        for (int i = 0; i < 20; ++i)
        {
            for (int j = 0; j < 20; ++j)
            {
                float noiseValue = PerlinNoise.Noise(mapFunction(0, 100, j * cubeSize.x * 1.2f), mapFunction(0, 100, i * cubeSize.z * 1.2f), var);
                // center.Set(j * cubeSize.x * 1.2f, 1 + 0.9f * noiseValue, i * cubeSize.z * 1.2f);
                center.Set(j * cubeSize.x * 1.2f, 1 + AudioAnalysis._freqBand[j], i * cubeSize.z * 1.2f);
                CreateCube(center);
            }
        }
        meshFilter.mesh = mg.CreateMesh();
    }
Exemplo n.º 2
0
 // Update is called once per frame
 void Update()
 {
     mg.Clear();
     var += Random.Range(0.05f, 0.2f);
     CreateSphere(resolution);
 }