Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why is zscale required? #16

Open
ghorn opened this issue Nov 17, 2021 · 1 comment
Open

why is zscale required? #16

ghorn opened this issue Nov 17, 2021 · 1 comment

Comments

@ghorn
Copy link

ghorn commented Nov 17, 2021

Why is zscale a required argument? Is it nonlinear - if you scale before vs after does it make a difference?

I ask because I postprocess the mesh to scale x/y to something independent of heightmap resolution, and at that time I have to consider the hmm z scaling. It'd be easier for my use case to either pass an x/y scaling as well as z to hmm, or to not pass a z scaling to hmm and do it myself afterwards alongside x/y. But if I have to pass an accurate z scaling to hmm for the algorithm to work well, then that's a good reason for it to be the way it is.

@DEF7
Copy link

DEF7 commented Dec 30, 2023

A grayscale heightmap image basically maps Z from zero to one. However, when outputting the resulting heightmap mesh the XY coords are in pixel coordinates of the heightmap. Hence, a zscale of 1 means that the grayscale heightmap will result in a mesh that can only be as tall as the width of one pixel (because zero-to-one is the width of a pixel on the X and Y axes).

zscale lets you specify how many pixel widths tall that the resulting mesh should be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants