mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-22 03:51:23 +01:00
Change to 1k granularity for points
This commit is contained in:
parent
e4718a0844
commit
cd4f69ef08
4 changed files with 39 additions and 7 deletions
|
|
@ -942,7 +942,7 @@
|
|||
<td></td>
|
||||
<td>Points number</td>
|
||||
<td>
|
||||
<input id="densityInput" type="range" min=1 max=10 value=1>
|
||||
<input id="densityInput" type="range" min=1 max=100 value=10>
|
||||
</td>
|
||||
<td>
|
||||
<output id="densityOutput">10K</output>
|
||||
|
|
|
|||
2
main.js
2
main.js
|
|
@ -615,7 +615,7 @@ 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
|
||||
const cellsDesired = 1000 * densityInput.value; // generate 1k points for each densityInput point
|
||||
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
|
||||
|
|
|
|||
|
|
@ -186,7 +186,23 @@
|
|||
}
|
||||
|
||||
function getBlobPower() {
|
||||
switch (+densityInput.value) {
|
||||
if (+densityInput.value < 10) {
|
||||
switch (+densityInput.value) {
|
||||
case 1: return .93;
|
||||
case 2: return .95;
|
||||
case 3: return .96;
|
||||
case 4: return .96;
|
||||
case 5: return .96;
|
||||
case 6: return .96;
|
||||
case 7: return .97;
|
||||
case 8: return .97;
|
||||
case 9: return .975;
|
||||
case 10: return .98;
|
||||
}
|
||||
}
|
||||
|
||||
let x = Math.max(1, rn(+densityInput.value / 10));
|
||||
switch (x) {
|
||||
case 1: return .98;
|
||||
case 2: return .985;
|
||||
case 3: return .987;
|
||||
|
|
@ -201,7 +217,23 @@
|
|||
}
|
||||
|
||||
function getLinePower() {
|
||||
switch (+densityInput.value) {
|
||||
if (+densityInput.value < 10) {
|
||||
switch (+densityInput.value) {
|
||||
case 1: return .74;
|
||||
case 2: return .75;
|
||||
case 3: return .76;
|
||||
case 4: return .77;
|
||||
case 5: return .78;
|
||||
case 6: return .79;
|
||||
case 7: return .795;
|
||||
case 8: return .80;
|
||||
case 9: return .805;
|
||||
case 10: return .81;
|
||||
}
|
||||
}
|
||||
|
||||
let x = Math.max(1, rn(+densityInput.value / 10));
|
||||
switch (x) {
|
||||
case 1: return .81;
|
||||
case 2: return .82;
|
||||
case 3: return .83;
|
||||
|
|
|
|||
|
|
@ -276,9 +276,9 @@ 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";
|
||||
densityOutput.value = value * 1 + "K";
|
||||
if (value > 50) densityOutput.style.color = "#b12117";
|
||||
else if (value > 10) densityOutput.style.color = "#dfdf12";
|
||||
else densityOutput.style.color = "#038603";
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue