I'm in the middle of programming something, and I really need a formula that can go from 0 to 1 depending on the distance an object is to another one. I can get the formula to return 1 if the objects' distance equals 0, but I need it to also take into account a minimum variable.
In short (and perhaps more accurately), if an object is beyond maxdist away, the formula should return 0 or less. If it's closer than mindist, it should return 1 or greater. I can clamp the values when necessary. This is what I have so far.
blenddist = 1.0 - ( ( 1.0 / gimaxdist) * dist)
Where would I work in mindist to allow me to set the 'zero-point'?