8000 why is zscale required? · Issue #16 · fogleman/hmm · GitHub
[go: up one dir, main page]

Skip to content

why is zscale required? #16

Open
Open

Description

@ghorn

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.

Activity

  1. DEF7 commented on Dec 30, 2023

    @DEF7

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0