| Package | org.ffilmation.engine.core |
| Class | public class fNoise |
<noiseDefinition name="Ground_noise_1">
<seed>0</seed>
<baseX>500</baseX>
<baseY>500</baseY>
<octaves>2</octaves>
<fractal>true</fractal>
</noiseDefinition>
seed: The random seed number to use. If you keep all other parameters the same, you can generate different pseudo-random results by varying the random seed value. The Perlin noise function creates the same results each time from the same random seed. Use 0 if you want the engine to pick a random one each time
baseX: Frequency to use in the x direction.
baseY: Frequency to use in the y direction.
octaves: Number of octaves or individual noise functions to combine to create this noise. Larger numbers of octaves create noise with greater detail. Larger numbers of octaves also require more processing time.
fractal: If the value is true, the method generates fractal noise; otherwise, it generates turbulence. An image with turbulence has visible discontinuities in the gradient that can make it better approximate sharper visual effects like flames and ocean waves.
See also
| Method | Defined by | ||
|---|---|---|---|
|
drawNoise(bmap:BitmapData, channels:uint, offx:Number, offy:Number):void
Draws this noise into a bitmpaData.
| fNoise | ||
|
getIntensityAt(x:*, y:*):Number
Returns the intensity ( from 0 to 1 ) of the perlin noise at a given coordinate.
| fNoise | ||
| drawNoise | () | method |
public function drawNoise(bmap:BitmapData, channels:uint, offx:Number, offy:Number):voidDraws this noise into a bitmpaData.
Parametersbmap:BitmapData — The BitmapData where the noise is to be drawn
|
|
channels:uint — A number that can be a combination of any of the four color channel values (BitmapDataChannel.RED, BitmapDataChannel.BLUE, BitmapDataChannel.GREEN, and BitmapDataChannel.ALPHA). You can use the logical OR operator (|) to combine channel values.
|
|
offx:Number — Horizontal offset that will be applied to the noise
|
|
offy:Number — Vertical offset that will be applied to the noise
|
| getIntensityAt | () | method |
public function getIntensityAt(x:*, y:*):NumberReturns the intensity ( from 0 to 1 ) of the perlin noise at a given coordinate.
Parametersx:* — Test coordinate X
|
|
y:* — Test coordinate Y
|
Number — A Number from 0 ( noise does not cover that coordinate at all ) and 1 ( noise fully covers that coordinate)
|