This noise module outputs concentric cylinders centered on the origin.
These cylinders are oriented along the y axis similar to the
concentric rings of a tree. Each cylinder extends infinitely along the
y axis.
By default, the first cylinder has a radius of 1.0. Each
subsequent cylinder has a radius that is 1.0 unit larger than the
previous cylinder.
The output value from this noise module is determined by the distance
between the input value and the nearest cylinder surface. The input values
that are located on a cylinder surface are given the output value 1.0
and the input values that are equidistant from two cylinder surfaces are
given the output value -1.0.
An application can change the frequency of the concentric cylinders.
Increasing the frequency reduces the distances between cylinders. To specify
the frequency, call the setFrequency(double) method.
This noise module, modified with some low-frequency, low-power turbulence, is useful for generating wood-like textures.
- Source Modules
- This module does not require any source modules.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doubleDefault frequency value for theCylindersnoise module.Fields inherited from class org.spongepowered.noise.module.NoiseModule
sourceModule -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleGet the frequency of the concentric cylinders.doubleget(double x, double y, double z) Generates an output value given the coordinates of the specified input value.voidsetFrequency(double frequency) Set the frequency of the concentric cylinders.Methods inherited from class org.spongepowered.noise.module.NoiseModule
setSourceModule, sourceModule, sourceModuleCount
-
Field Details
-
DEFAULT_CYLINDERS_FREQUENCY
public static final double DEFAULT_CYLINDERS_FREQUENCYDefault frequency value for theCylindersnoise module.- See Also:
-
-
Constructor Details
-
Cylinders
public Cylinders()
-
-
Method Details
-
frequency
public double frequency()Get the frequency of the concentric cylinders.Increasing the frequency increases the density of the concentric cylinders, reducing the distances between them.
- Returns:
- the frequency of the concentric cylinders
-
setFrequency
public void setFrequency(double frequency) Set the frequency of the concentric cylinders.Increasing the frequency increases the density of the concentric cylinders, reducing the distances between them.
- Parameters:
frequency- the frequency of the concentric cylinders
-
get
public double get(double x, double y, double z) Description copied from class:NoiseModuleGenerates an output value given the coordinates of the specified input value.All source modules required by this module must have been connected with the
NoiseModule.setSourceModule(int, NoiseModule)method. If these source modules are not connected, this method will throw aNoModuleException.To determine the number of source modules required by this noise module, call the
NoiseModule.sourceModuleCount()method.- Specified by:
getin classNoiseModule- Parameters:
x- thexcoordinate of the input valuey- theycoordinate of the input valuez- thezcoordinate of the input value- Returns:
- the output value
-