Jump to content

Fit range confusion


Recommended Posts

Hi,

I was watching a tutorial and the instructor used negative value in fit range node's source min parameter and then he said that as there is a negative value in source min so he will have to flip the the destination min to 1 and destination max to 0. I don't know why we must do that. Can anybody please explain the math behind this?

Fit Range Node's details: source min = -5, source max = 1, destination min = 1, destination max = 0. in the value parameter he takes some random attribute that ranges from -5 to 5 based on the point numbers.

Link to comment
Share on other sites

This will reverse output. In this case, where range 0..1 will output 0, range 1..0 will output 1:

src [-5, 0]: -5.0 -4.5 -4.0 -3.5 -3.0 -2.5 -2.0 -1.5 -1.0 -0.5  0.0
dest [0, 1]:  0.0  0.1  0.2  0.3  0.4  0.5  0.6  0.7  0.8  0.9  1.0

src [-5, 0]: -5.0 -4.5 -4.0 -3.5 -3.0 -2.5 -2.0 -1.5 -1.0 -0.5  0.0
dest [1, 0]:  1.0  0.9  0.8  0.7  0.6  0.5  0.4  0.3  0.2  0.1  0.0

Not necessary to swap destination min and max if the source min is negative, the instructor probably had some reason to invert the range (better logic, later convenience, etc.). Try visualize the value.

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...