mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 01:41:22 +01:00
v1.6.24 - #488 fixed?
This commit is contained in:
parent
00189f2185
commit
220ac7832b
2 changed files with 1 additions and 8 deletions
7
main.js
7
main.js
|
|
@ -944,9 +944,6 @@ function reGraph() {
|
||||||
const newCells = {p:[], g:[], h:[]}; // to store new data
|
const newCells = {p:[], g:[], h:[]}; // to store new data
|
||||||
const spacing2 = grid.spacing ** 2;
|
const spacing2 = grid.spacing ** 2;
|
||||||
|
|
||||||
console.log("Graph points:", points);
|
|
||||||
console.log("Graph T points:", cells.t);
|
|
||||||
|
|
||||||
for (const i of cells.i) {
|
for (const i of cells.i) {
|
||||||
const height = cells.h[i];
|
const height = cells.h[i];
|
||||||
const type = cells.t[i];
|
const type = cells.t[i];
|
||||||
|
|
@ -978,8 +975,6 @@ function reGraph() {
|
||||||
newCells.h.push(height);
|
newCells.h.push(height);
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("New points:", newCells.p);
|
|
||||||
|
|
||||||
calculateVoronoi(pack, newCells.p);
|
calculateVoronoi(pack, newCells.p);
|
||||||
cells = pack.cells;
|
cells = pack.cells;
|
||||||
cells.p = newCells.p; // points coordinates [x, y]
|
cells.p = newCells.p; // points coordinates [x, y]
|
||||||
|
|
@ -1059,7 +1054,6 @@ function drawCoastline() {
|
||||||
const chain = []; // vertices chain to form a path
|
const chain = []; // vertices chain to form a path
|
||||||
for (let i=0, current = start; i === 0 || current !== start && i < 50000; i++) {
|
for (let i=0, current = start; i === 0 || current !== start && i < 50000; i++) {
|
||||||
const prev = chain[chain.length-1]; // previous vertex in chain
|
const prev = chain[chain.length-1]; // previous vertex in chain
|
||||||
//d3.select("#labels").append("text").attr("x", vertices.p[current][0]).attr("y", vertices.p[current][1]).text(i).attr("font-size", "1px");
|
|
||||||
chain.push(current); // add current vertex to sequence
|
chain.push(current); // add current vertex to sequence
|
||||||
const c = vertices.c[current] // cells adjacent to vertex
|
const c = vertices.c[current] // cells adjacent to vertex
|
||||||
const v = vertices.v[current] // neighboring vertices
|
const v = vertices.v[current] // neighboring vertices
|
||||||
|
|
@ -1071,7 +1065,6 @@ function drawCoastline() {
|
||||||
if (v[2] !== prev && c0 !== c2) current = v[2];
|
if (v[2] !== prev && c0 !== c2) current = v[2];
|
||||||
if (current === chain[chain.length-1]) {ERROR && console.error("Next vertex is not found"); break;}
|
if (current === chain[chain.length-1]) {ERROR && console.error("Next vertex is not found"); break;}
|
||||||
}
|
}
|
||||||
//chain.push(chain[0]); // push first vertex as the last one
|
|
||||||
return chain;
|
return chain;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
const limits = outline === "random" ? randomizeOutline() : outline.split(",").map(s => +s);
|
const limits = outline === "random" ? randomizeOutline() : outline.split(",").map(s => +s);
|
||||||
|
|
||||||
const chains = [];
|
const chains = [];
|
||||||
const opacity = rn(0.4 / limits.length, 2);
|
const opacity = rn(.4 / limits.length, 2);
|
||||||
used = new Uint8Array(pointsN); // to detect already passed cells
|
used = new Uint8Array(pointsN); // to detect already passed cells
|
||||||
|
|
||||||
for (const i of cells.i) {
|
for (const i of cells.i) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue