|
SQR can help you...
You can use the following to scale up or scale down your joysticks
Value = Sqr (Value) << 4
and
Value = Value* Value >> 8
Both transformations give you 0=>0 and 256=>256 but what happens in between is either concave or convex.
Try it out.
You will have to modify code I gave already to put the squaring or squareroot in the right place.
It should not be to hard to noodle out.
Basically it only works on positive values (just like the scaling only works on positive values) so you have to make sure whatever you are scaling is positive before you apply the operation.
Good luck.
Joe J.
P.S. This method of shifting was first introduced to me by Sister Mary Katherine at my highschool. Sister was a wonderful woman but not a wiz when it came to math. Her method of curving an exam was to either take the square root of a raw test score and then multiply it by 10 if the exam was too hard or to take the score, square it and then divide by 100 if it was too easy. She had no idea why it worked and didn't care. I puzzled about it for quite a while. Now I share it with you, generalized for base 16. JJ
|