Clamp function

Yeah I didn’t do a good job at showing it… that definitely let to confusion

If, however, you are looking to rescale a value from a range (a .. b) to another range (c .. d), you will need a whole different formula:

… and of course it’s the same as @bh suggested.

That’s what I’m pretty sure bh’s does but it’s definitely a lot and you’d be able to find a better way to do it with snaps mechanics

What @bh suggested is simple enough.

I wouldn’t call this simple..

Neither would I. But then I was referring to posts #18 (@bh) and #22 (@qw23).

That's because you aren't taking advantage of procedural abstraction. So, for example, you have all those calls to MAX and MIN. Instead, do this:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.