Jump to content

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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×