Difference between revisions of "Perlin Noise/zh CN"

From Lazarus wiki
Jump to navigationJump to search
 
Line 2: Line 2:
  
 
This page is the start of a tutorial about using Perlin Noise on LCL applications to generate natural looking images. It will cover both basic theory and real usage examples, with a focus on compilable examples.
 
This page is the start of a tutorial about using Perlin Noise on LCL applications to generate natural looking images. It will cover both basic theory and real usage examples, with a focus on compilable examples.
 +
 +
<strike>这个页面是关于LCL应用程序使用柏林噪声来生成自然图像的教程。它包括基础理论和实际使用的例子,重点是编译的例子。</strike>
 +
  
 
Perlin Noise was invented by [http://mrl.nyu.edu/~perlin/ Ken Perlin] to generate textures for a movie called Tron. Today it is widely used on movies and video games to produce natural looking smoke, landscapes, clouds and any texture including marble, irregular glass,  etc.
 
Perlin Noise was invented by [http://mrl.nyu.edu/~perlin/ Ken Perlin] to generate textures for a movie called Tron. Today it is widely used on movies and video games to produce natural looking smoke, landscapes, clouds and any texture including marble, irregular glass,  etc.
 +
 +
<strike>[http://mrl.nyu.edu/~perlin/ Ken Perlin] 在为电影Tron生成纹理时发明了柏林噪声。如今,它被广泛应用于电影和视频游戏中的自然烟雾,山水、云和任何纹理,包括大理石、不规则玻璃等。</strike>
 +
  
 
__TOC__
 
__TOC__
Line 11: Line 17:
 
Perlin Noise is based on the idea of fractals, that things in nature show different degrees of change. On a rocky mountain landscape for example when can see changes with a very big amplitude, which are the mountains themselves. Smaller changes represent irregularities on those mountains and even smaller ones represent rocks.
 
Perlin Noise is based on the idea of fractals, that things in nature show different degrees of change. On a rocky mountain landscape for example when can see changes with a very big amplitude, which are the mountains themselves. Smaller changes represent irregularities on those mountains and even smaller ones represent rocks.
  
 +
<strike>柏林噪声是基于分形的思想,事物在本质上呈现出不同程度的变化。以岩石山为例,可以看到非常大的幅度变化,这是山本身。较小的变化代表了那些山的凹凸,甚至更小的代表岩石。</strike>
 
[[Image:mountain_landscape.png]]
 
[[Image:mountain_landscape.png]]
  
Line 17: Line 24:
  
 
This application demonstrates a simple noise function with the following properties:
 
This application demonstrates a simple noise function with the following properties:
 +
<strike>这个应用程序演示了一个简单的噪声函数,它具有以下属性:</strike>
  
* Only 1 harmonic present
+
* Only 1 harmonic present<strike>只呈现1个谐波</strike>
* Amplitude of 250 pixels
+
* 振幅 250 像素
* Wavelength of 20 pixels
+
* 波长 20 像素
* Frequency of 0.05
+
* 频率 0.05
 
* You can use a combo box to choose between Linear, Cossine and Cubic interpolation
 
* You can use a combo box to choose between Linear, Cossine and Cubic interpolation
 +
<strike>你可以在组合框中选择线性,余弦、三次插值。</strike>
  
 
[[Image:Noise1D.png]]
 
[[Image:Noise1D.png]]
Line 34: Line 43:
 
== 持续示例 ==
 
== 持续示例 ==
  
This application demonstrates how to sum many noise functions to get a perlin noise function. It has the following properties:
+
This application demonstrates how to sum many noise functions to get a perlin noise function.
 +
<strike>这个应用程序演示了多个噪声函数实现的柏林噪声。</strike>
 +
它有以下属性:
  
* 3 harmonics present
+
* 3 harmonics present<strike>显现3个谐波</strike>
* Amplitudes of 250, 125 and 62 pixels
+
* 振幅 250, 125 62 像素
* Wavelength of 20, 10, and 5 pixels
+
* 波长 20, 10, 5 像素
* Frequency of 0.05, 0.1, 0.2
+
* 频率 0.05, 0.1, 0.2
 
* You can use a combo box to choose between Linear, Cossine and Cubic interpolation
 
* You can use a combo box to choose between Linear, Cossine and Cubic interpolation
 +
<strike>你可以在组合框中选择线性,余弦、三次插值。</strike>
 +
  
 
[[Image:Perlin1D.png]]
 
[[Image:Perlin1D.png]]
Line 53: Line 66:
  
 
It is possible to create tilable textures of stone, water, wood... with Perlin noise.
 
It is possible to create tilable textures of stone, water, wood... with Perlin noise.
 +
<strike>它可以创建tilable纹理的石头、水、木头...与柏林噪声。</strike>
  
Here is a tutorial on how to do this: [[BGRABitmap tutorial 8]]
+
这里是如何做到这一点的教程: [[BGRABitmap tutorial 8]]
  
 
== SVN ==
 
== SVN ==
  
You can download the source code for the examples and the library using this command:
+
你可以使用下面的命令下载源代码、示例:
  
 
svn co https://lazarus-ccr.svn.sourceforge.net/svnroot/lazarus-ccr/examples/noise noise
 
svn co https://lazarus-ccr.svn.sourceforge.net/svnroot/lazarus-ccr/examples/noise noise
Line 64: Line 78:
 
== 外部链接 ==
 
== 外部链接 ==
  
* [http://freespace.virgin.net/hugo.elias/models/m_perlin.htm Article] with the theory of Perlin Noise.
+
* [http://freespace.virgin.net/hugo.elias/models/m_perlin.htm 柏林噪声理论]
  
 
[[Category:Tutorials]]
 
[[Category:Tutorials]]

Revision as of 09:30, 6 May 2014

English (en) français (fr) 中文(中国大陆)‎ (zh_CN)

This page is the start of a tutorial about using Perlin Noise on LCL applications to generate natural looking images. It will cover both basic theory and real usage examples, with a focus on compilable examples.

这个页面是关于LCL应用程序使用柏林噪声来生成自然图像的教程。它包括基础理论和实际使用的例子,重点是编译的例子。


Perlin Noise was invented by Ken Perlin to generate textures for a movie called Tron. Today it is widely used on movies and video games to produce natural looking smoke, landscapes, clouds and any texture including marble, irregular glass, etc.

Ken Perlin 在为电影Tron生成纹理时发明了柏林噪声。如今,它被广泛应用于电影和视频游戏中的自然烟雾,山水、云和任何纹理,包括大理石、不规则玻璃等。


入门

Perlin Noise is based on the idea of fractals, that things in nature show different degrees of change. On a rocky mountain landscape for example when can see changes with a very big amplitude, which are the mountains themselves. Smaller changes represent irregularities on those mountains and even smaller ones represent rocks.

柏林噪声是基于分形的思想,事物在本质上呈现出不同程度的变化。以岩石山为例,可以看到非常大的幅度变化,这是山本身。较小的变化代表了那些山的凹凸,甚至更小的代表岩石。 mountain landscape.png


第一个例子

This application demonstrates a simple noise function with the following properties: 这个应用程序演示了一个简单的噪声函数,它具有以下属性:

  • Only 1 harmonic present只呈现1个谐波
  • 振幅 250 像素
  • 波长 20 像素
  • 频率 0.05
  • You can use a combo box to choose between Linear, Cossine and Cubic interpolation

你可以在组合框中选择线性,余弦、三次插值。

Noise1D.png

文件:

  • noise1d.lpi
  • noise1d.dpr
  • noise.pas

持续示例

This application demonstrates how to sum many noise functions to get a perlin noise function. 这个应用程序演示了多个噪声函数实现的柏林噪声。 它有以下属性:

  • 3 harmonics present显现3个谐波
  • 振幅 250, 125 和 62 像素
  • 波长 20, 10, 和 5 像素
  • 频率 0.05, 0.1, 0.2
  • You can use a combo box to choose between Linear, Cossine and Cubic interpolation

你可以在组合框中选择线性,余弦、三次插值。


Perlin1D.png

文件:

  • perlin1d.lpi
  • perlin1d.dpr
  • noise.pas

使用柏林噪声创建纹理

It is possible to create tilable textures of stone, water, wood... with Perlin noise. 它可以创建tilable纹理的石头、水、木头...与柏林噪声。

这里是如何做到这一点的教程: BGRABitmap tutorial 8

SVN

你可以使用下面的命令下载源代码、示例:

svn co https://lazarus-ccr.svn.sourceforge.net/svnroot/lazarus-ccr/examples/noise noise

外部链接