Saturday 31 August 2013

Parametrizing a value

Sometimes you will need the user to enter a value range 20 - 40 without telling user. You set this formula:

#define parametrizeVal(x,lo,hi) lo+x*(hi-lo)
float specVal = parametrizeVal(specParam, 20 ,40);

This way the user will have the input between 0 -1 and remap it to 20 -40

No comments:

Post a Comment