I cant figure out a good way of doing this one.
It should take the range of fmin to fmax and the relitave position cur, and return a relitave position that is from imin to imax.Code:int ConvertRange(float fmin, float fmax, float cur, int imin, int imax) {
int i;
return i;
}
EXAMPLE
fmin = 0.0f
fmax = 1.0f
cur = 0.1
imin = 0
imax = 10
return = 1