noise3Classic method

  1. @override
double noise3Classic(
  1. double x,
  2. double y,
  3. double z
)
override

3D Re-oriented 4-point BCC noise, classic orientation.

Proper substitute for 3D Simplex in light of Forbidden Formulae. Use noise3XYBeforeZ or noise3XZBeforeY instead, wherever appropriate.

Implementation

@override
double noise3Classic(double x, double y, double z) {
  // Re-orient the cubic lattices via rotation, to produce the expected look on cardinal planar slices.
  // If texturing objects that don't tend to have cardinal plane faces, you could even remove this.
  // Orthonormal rotation. Not a skew transform.
  double r = (2.0 / 3.0) * (x + y + z);
  double xr = r - x, yr = r - y, zr = r - z;

  // Evaluate both lattices to form a BCC lattice.
  return _noise3BCC(xr, yr, zr);
}