unity3d 柏林噪声 PerlinNoise 规律 算法
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了unity3d 柏林噪声 PerlinNoise 规律 算法相关的知识,希望对你有一定的参考价值。
测试 每个小数值取100次
print(0.1);
LaTest3(0.1f, 0.1f);
print("Max:" + La.Max() + "|Min:" + La.Min() + "|AVG:" + La.Average()+ "|Between:"+ (La.Max()-La.Min()));
print(0.3);
LaTest3(0.3f, 0.3f);
print("Max:" + La.Max() + "|Min:" + La.Min() + "|AVG:" + La.Average() + "|Between:" + (La.Max() - La.Min()));
print(0.5);
LaTest3(0.5f, 0.5f);
print("Max:" + La.Max() + "|Min:" + La.Min() + "|AVG:" + La.Average() + "|Between:" + (La.Max() - La.Min()));
print(0.7);
LaTest3(0.7f, 0.7f);
print("Max:" + La.Max() + "|Min:" + La.Min() + "|AVG:" + La.Average() + "|Between:" + (La.Max() - La.Min()));
print(0.9);
LaTest3(0.9f, 0.9f);
print("Max:" + La.Max() + "|Min:" + La.Min() + "|AVG:" + La.Average() + "|Between:" + (La.Max() - La.Min()));
print("X:" + 0.1 + "Y" + 0.3);
LaTest3(0.1f, 0.3f);
print("Max:" + La.Max() + "|Min:" + La.Min() + "|AVG:" + La.Average() + "|Between:" + (La.Max() - La.Min()));
print("X:"+0.1+"Y"+0.5);
LaTest3(0.1f, 0.5f);
print("Max:" + La.Max() + "|Min:" + La.Min() + "|AVG:" + La.Average() + "|Between:" + (La.Max() - La.Min()));
print("X:" + 0.1 + "Y" + 0.9);
LaTest3(0.1F, 0.9F);
print("Max:" + La.Max() + "|Min:" + La.Min() + "|AVG:" + La.Average() + "|Between:" + (La.Max() - La.Min()));
print("X:" + 0.3 + "Y" + 0.1);
LaTest3(0.3f, 0.1f);
print("Max:" + La.Max() + "|Min:" + La.Min() + "|AVG:" + La.Average() + "|Between:" + (La.Max() - La.Min()));
print("X:" + 0.5 + "Y" + 0.1);
LaTest3(0.5F, 0.1F);
print("Max:" + La.Max() + "|Min:" + La.Min() + "|AVG:" + La.Average() + "|Between:" + (La.Max() - La.Min())); ;
print("X:" + 0.9 + "Y" + 0.1);
LaTest3(0.9F, 0.1F);
print("Max:" + La.Max() + "|Min:" + La.Min() + "|AVG:" + La.Average() + "|Between:" + (La.Max() - La.Min()));
LaTest3函数
List<float> La; float[] LaTest3(float x, float y) { La = new List<float>(); for (int i = 0; i < 100; i++) { La.Add(Mathf.PerlinNoise(x+(i), y + (i))); } return La.ToArray(); }
越接近0.5幅度越大,两边则越平缓
与整数无关,小数决定幅度。
以上是关于unity3d 柏林噪声 PerlinNoise 规律 算法的主要内容,如果未能解决你的问题,请参考以下文章