diff --git a/index.html b/index.html index 13815826..13f9793b 100644 --- a/index.html +++ b/index.html @@ -942,7 +942,7 @@ Points number - + 10K diff --git a/main.js b/main.js index adac14e0..1ba74caf 100644 --- a/main.js +++ b/main.js @@ -615,7 +615,12 @@ function generateSeed() { // Place points to calculate Voronoi diagram function placePoints() { TIME && console.time("placePoints"); - const cellsDesired = 10000 * densityInput.value; // generate 10k points for each densityInput point + let cellsDesired = 10000 * (+densityInput.value - 3); // generate 10k points for each densityInput point + switch (+densityInput.value) { + case 1: cellsDesired = 1000; break; + case 2: cellsDesired = 2000; break; + case 3: cellsDesired = 5000; break; + } const spacing = grid.spacing = rn(Math.sqrt(graphWidth * graphHeight / cellsDesired), 2); // spacing between points before jirrering grid.boundary = getBoundaryPoints(graphWidth, graphHeight, spacing); grid.points = getJitteredGrid(graphWidth, graphHeight, spacing); // jittered square grid diff --git a/modules/heightmap-generator.js b/modules/heightmap-generator.js index e469b4dc..38179428 100644 --- a/modules/heightmap-generator.js +++ b/modules/heightmap-generator.js @@ -187,31 +187,37 @@ function getBlobPower() { switch (+densityInput.value) { - case 1: return .98; - case 2: return .985; - case 3: return .987; - case 4: return .9892; - case 5: return .9911; - case 6: return .9921; - case 7: return .9934; - case 8: return .9942; - case 9: return .9946; - case 10: return .995; + case 1: return .93; + case 2: return .95; + case 3: return .96; + case 4: return .98; + case 5: return .985; + case 6: return .987; + case 7: return .9892; + case 8: return .9911; + case 9: return .9921; + case 10: return .9934; + case 11: return .9942; + case 12: return .9946; + case 13: return .995; } } function getLinePower() { switch (+densityInput.value) { - case 1: return .81; - case 2: return .82; - case 3: return .83; - case 4: return .84; - case 5: return .855; - case 6: return .87; - case 7: return .885; - case 8: return .91; - case 9: return .92; - case 10: return .93; + case 1: return .74; + case 2: return .75; + case 3: return .78; + case 4: return .81; + case 5: return .82; + case 6: return .83; + case 7: return .84; + case 8: return .855; + case 9: return .87; + case 10: return .885; + case 11: return .91; + case 12: return .92; + case 13: return .93; } } diff --git a/modules/ui/options.js b/modules/ui/options.js index 26e3329e..26deb348 100644 --- a/modules/ui/options.js +++ b/modules/ui/options.js @@ -276,9 +276,14 @@ function copyMapURL() { } function changeCellsDensity(value) { - densityOutput.value = value * 10 + "K"; - if (value > 5) densityOutput.style.color = "#b12117"; - else if (value > 1) densityOutput.style.color = "#dfdf12"; + switch (value) { + case 1 : densityOutput.value = "1K"; break; + case 2 : densityOutput.value = "2K"; break; + case 3 : densityOutput.value = "5K"; break; + default: densityOutput.value = (value-3) * 10 + "K"; + } + if (value > 9) densityOutput.style.color = "#b12117"; + else if (value > 4) densityOutput.style.color = "#dfdf12"; else densityOutput.style.color = "#038603"; }