Packageorg.ffilmation.engine.core
Classpublic class fNoise

This object stores a perlin noise definition that was loaded from a definition file. Noise definitions are used internally by Perlin materials but can be used externally to scatter objects along a surface, for example


Example
Here's an example of a noise definition in a definition XML
    <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

org.ffilmation.engine.materials.fPerlinMaterial


Public Methods
 MethodDefined 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
Method detail
drawNoise()method
public function drawNoise(bmap:BitmapData, channels:uint, offx:Number, offy:Number):void

Draws this noise into a bitmpaData.

Parameters
bmap: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:*):Number

Returns the intensity ( from 0 to 1 ) of the perlin noise at a given coordinate.

Parameters
x:* — Test coordinate X
 
y:* — Test coordinate Y

Returns
Number — A Number from 0 ( noise does not cover that coordinate at all ) and 1 ( noise fully covers that coordinate)