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函数

1
2
3
4
5
6
7
8
9
10
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幅度越大,两边则越平缓

与整数无关,小数决定幅度。

 

 

 

 

 

 

posted @   AnAng  阅读(2324)  评论(0编辑  收藏  举报
编辑推荐:
· .NET Core GC压缩(compact_phase)底层原理浅谈
· 现代计算机视觉入门之:什么是图片特征编码
· .NET 9 new features-C#13新的锁类型和语义
· Linux系统下SQL Server数据库镜像配置全流程详解
· 现代计算机视觉入门之:什么是视频
阅读排行:
· 【译】我们最喜欢的2024年的 Visual Studio 新功能
· 个人数据保全计划:从印象笔记迁移到joplin
· Vue3.5常用特性整理
· 重拾 SSH:从基础到安全加固
· 为什么UNIX使用init进程启动其他进程?
点击右上角即可分享
微信分享提示