mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 09:41:24 +01:00
draw images from heightmap
This commit is contained in:
parent
c394534246
commit
27a045b709
3 changed files with 103 additions and 34 deletions
|
|
@ -1360,7 +1360,7 @@ function editHeightmap() {
|
|||
const imageData = ctx.createImageData(grid.cellsX, grid.cellsY);
|
||||
|
||||
grid.cells.h.forEach((height, i) => {
|
||||
let h = height < 20 ? Math.max(height / 1.5, 0) : height;
|
||||
const h = height < 20 ? Math.max(height / 1.5, 0) : height;
|
||||
const v = (h / 100) * 255;
|
||||
imageData.data[i * 4] = v;
|
||||
imageData.data[i * 4 + 1] = v;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue