Java:2D Perlin 噪声创建
市面上没有多少易于理解的 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
幅度和频率在柏林噪声生成中不是自由变量。相反,它们通过所谓的“持久性”进行参数化。
噪声函数是几个基本函数的总和。
每个函数都称为“octave”,因此由索引“i”编号。值
f_i
表示频率,a_i
表示幅度。如前所述,它们完全由索引i
本身决定,并由 持久性p
参数化:虽然每个噪声函数
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.
Each function is called octave and therefore numbered by the index
i
. The valuesf_i
denote the frequencies anda_i
the amplitudes. As mentioned before they are completely determined by the indexi
itself, parametrized by the persistencep
:While each noise function
n_i(x)
is normalized for frequency1
and amplitude1
, the overall termn_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 frequency1
and amplitude1
, the second one has frequency2
and amplitudep
, the third has frequency4
and amplitudep^2
, and so on.