Closed foobarbecue closed 5 years ago
Thanks for the PR. This does look like a bug, however the provided change does not fix the bug. In order to fix the bug, we additionally need to change the definition of spread
to max - min
, and change the hasMax
and hasMin
definitions to check for !==
instead of ===
. Would you be willing to update this PR with those changes?
Essentially, calling
toHeightmap([{ x: 0, y: -10, z: -10}, { x: 0, y: 10, z: 10 }], { xSegments: 0, ySegments: 1 })
should produce one black pixel and one white pixel.
Ah, yeah... hopefully I'll get to it this weekend.
Oh, wait, this is super simple. I misunderstood. I had actually already fixed the spread
definition on my local version failed to commit it.
Great, thanks!
When options.minHeight is unset, THREE.Terrain.toHeightmap calculates a min value for scaling the output image (0 to 255). However, it was not using this value. Presumably this was a bug.