mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 09:41:24 +01:00
height generation - ability to pass cells number
This commit is contained in:
parent
ab160e609c
commit
4f372c7a46
3 changed files with 66 additions and 42 deletions
|
|
@ -940,7 +940,11 @@ function editHeightmap(options) {
|
|||
const seed = byId("templateSeed").value;
|
||||
if (seed) Math.random = aleaPRNG(seed);
|
||||
|
||||
HeightmapGenerator.resetHeights();
|
||||
const heights = new Uint8Array(grid.points.length);
|
||||
// use cells number of the current graph, no matter what UI input value is
|
||||
const cellsDesired = rn((graphWidth * graphHeight) / grid.spacing ** 2, -3);
|
||||
HeightmapGenerator.setHeights(heights, cellsDesired);
|
||||
|
||||
restartHistory();
|
||||
|
||||
for (const step of steps) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue