Class CheckerboardNoiseGenerator
java.lang.Object
de.articdive.jnoise.generators.noisegen.pattern.CheckerboardNoiseGenerator
- All Implemented Interfaces:
NoiseGenerator
,NoiseSource
A noise generator that returns a checkerboard of unit-sized blocks alternating between 0.0 and 1.0.
Useful when combined with the scale transformer, as you can create blocks of any size.
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptiondouble
evaluateNoise
(double x) Evaluates noise at a 1D point.double
evaluateNoise
(double x, double y) Evaluates noise at a 2D point.double
evaluateNoise
(double x, double y, double z) Evaluates noise at a 3D point.double
evaluateNoise
(double x, double y, double z, double w) Evaluates noise at a 4D point.Gets aCheckerboardNoiseGenerator.CheckerboardNoiseBuilder
to build aCheckerboardNoiseGenerator
.
-
Method Details
-
evaluateNoise
public double evaluateNoise(double x) Description copied from interface:NoiseSource
Evaluates noise at a 1D point.- Specified by:
evaluateNoise
in interfaceNoiseSource
- Parameters:
x
- X-Coordinate of the 1D point.- Returns:
- noise value at the 1D point.
-
evaluateNoise
public double evaluateNoise(double x, double y) Description copied from interface:NoiseSource
Evaluates noise at a 2D point.- Specified by:
evaluateNoise
in interfaceNoiseSource
- Parameters:
x
- X-Coordinate of the 2D point.y
- Y-Coordinate of the 2D point.- Returns:
- noise value at the 2D point.
-
evaluateNoise
public double evaluateNoise(double x, double y, double z) Description copied from interface:NoiseSource
Evaluates noise at a 3D point.- Specified by:
evaluateNoise
in interfaceNoiseSource
- Parameters:
x
- X-Coordinate of the 3D point.y
- Y-Coordinate of the 3D point.z
- Z-Coordinate of the 3D point.- Returns:
- noise value at the 3D point.
-
evaluateNoise
public double evaluateNoise(double x, double y, double z, double w) Description copied from interface:NoiseSource
Evaluates noise at a 4D point.- Specified by:
evaluateNoise
in interfaceNoiseSource
- Parameters:
x
- X-Coordinate of the 4D point.y
- Y-Coordinate of the 4D point.z
- Z-Coordinate of the 4D point.w
- W-Coordinate of the 4D point.- Returns:
- noise value at the 4D point.
-
newBuilder
Gets aCheckerboardNoiseGenerator.CheckerboardNoiseBuilder
to build aCheckerboardNoiseGenerator
.
-