jvx.numeric
Class PnNoise
java.lang.Object
|
+--jvx.numeric.PnNoise
- public class PnNoise
- extends java.lang.Object
Generates 2D procedural white noise by hashtable-like method to generate
a gradient on an integer lattice that is
made continuous by smoothed interpolation. Noise is 256-periodic.
|
Constructor Summary |
PnNoise()
Creates and initializes new noise |
|
Method Summary |
protected double |
glattice(int ix,
int iy,
double fx,
double fy)
Gets the share of a single lattice point to the gradient value
of point (ix+fx, iy+fy). |
protected int |
index(int x,
int y)
Gets the table index of the integer lattice point (x,y). |
double |
noise(double x,
double y)
Value of white noise at given 2D point. |
protected double |
smoothstep(double x)
Smoothed linear interpolation between zero and one. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PnNoise
public PnNoise()
- Creates and initializes new noise
index
protected int index(int x,
int y)
- Gets the table index of the integer lattice point (x,y).
glattice
protected double glattice(int ix,
int iy,
double fx,
double fy)
- Gets the share of a single lattice point to the gradient value
of point (ix+fx, iy+fy).
smoothstep
protected double smoothstep(double x)
- Smoothed linear interpolation between zero and one.
- Parameters:
x - out of [0;1]
noise
public double noise(double x,
double y)
- Value of white noise at given 2D point.
- Returns:
- noise value [-1;1]
The software JavaView® is copyright protected. All Rights Reserved.