1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-11-22 20:58:34 +01:00

remove octaves

This commit is contained in:
Ellpeck 2019-08-07 11:31:03 +02:00
parent 528f314c3f
commit 3cde47c762

View file

@ -27,19 +27,6 @@ namespace MLEM.Noise {
} }
} }
public static double GenerateOctaves(double x, double y, double z, int octaves, double persistence) {
var total = 0D;
var frequency = 1D;
var amplitude = 1D;
for (var i = 0; i < octaves; i++) {
total += Generate(x * frequency, y * frequency, z * frequency) * amplitude;
amplitude *= persistence;
frequency *= 2;
}
return total;
}
public static double Generate(double x, double y, double z) { public static double Generate(double x, double y, double z) {
var xi = (int) x & 255; // Calculate the "unit cube" that the point asked will be located in var xi = (int) x & 255; // Calculate the "unit cube" that the point asked will be located in
var yi = (int) y & 255; // The left bound is ( |_x_|,|_y_|,|_z_| ) and the right bound is that var yi = (int) y & 255; // The left bound is ( |_x_|,|_y_|,|_z_| ) and the right bound is that