Java:2D Perlin 噪声创建

发布于 2024-12-22 19:40:08 字数 352 浏览 2 评论 0原文

市面上没有多少易于理解的 Perlin Noise 教程,当然也没有 Java 或 2D 教程。我在一定程度上遵循了这个教程,但它并没有解释二维噪声非常非常。我知道你必须生成一个数字数组,然后对它们进行插值等等。我的问题是我不知道如何实现频率、持久性或幅度来帮助影响数字结果。谁能给我一些基本的 Perlin Noise 函数或者 Java 或类似语言的 2D Perlin Noise 教程的链接?谢谢!

编辑:有人可以至少简要解释一下这个过程,或者如何实现频率、幅度和持久性来影响生成?请 :)

There are not many easy-to-follow Perlin Noise tutorials out there and certainly not in Java or 2D. I followed this tutorial to a point but it doesn't explain 2D noise very much at all. I know you have to generate an array of numbers then interpolate them and everything. My problem is that I do not know how to implement frequency, persistence, or amplitude to help affect the outcome of the numbers. Can anyone give me some basic Perlin Noise functions or a link to a 2D Perlin Noise tutorial in Java or similar languages? Thanks!

EDIT: Can someone just briefly explain the process at least or how one implements the frequency, amplitude, and persistence to influence the generation? Please :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

美人如玉 2024-12-29 19:40:08

幅度频率在柏林噪声生成中不是自由变量。相反,它们通过所谓的“持久性”进行参数化。

噪声函数是几个基本函数的总和。

n(x) = sum( n_i(x*f_i) * a_i, i=0..N-1)

每个函数都称为“octave”,因此由索引“i”编号。值f_i 表示频率,a_i 表示幅度。如前所述,它们完全由索引 i 本身决定,并由 持久性 p 参数化:

f_i = 2^i
a_i = p^i

虽然每个噪声函数 n_i(x ) 针对频率 1 和幅度 1 进行归一化,总体项 n_i(x*f_i) * a_i 现在具有频率和幅度由上面的表达式给出。

换句话说,噪声函数 n(x) 是八度音程之和,其中第一个具有频率 1 和幅度 1,第二个具有频率 1 和幅度 1具有频率2和幅度p,第三个具有频率4和幅度p^2,依此类推。

Amplitude and frequency are no free variables in the Perlin Noise generation. Instead they are parametrized by something called persistence.

The noise function is then the sum over several basic functions.

n(x) = sum( n_i(x*f_i) * a_i, i=0..N-1)

Each function is called octave and therefore numbered by the index i. The values f_i denote the frequencies and a_i the amplitudes. As mentioned before they are completely determined by the index i itself, parametrized by the persistence p:

f_i = 2^i
a_i = p^i

While each noise function n_i(x) is normalized for frequency 1 and amplitude 1, the overall term n_i(x*f_i) * a_i now has frequency and amplitude given by the expressions above.

In other words the noise function n(x) is the sum of octaves where the first one has frequency 1 and amplitude 1, the second one has frequency 2 and amplitude p, the third has frequency 4 and amplitude p^2, and so on.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文