e***@gmail.com
2006-10-09 15:52:22 UTC
Hi everyone,
I'm writing a game in c++ that's using directInput for gamepad support.
I want the right analog stick to be used as a unit circle (simply an x
& y vector between -1 and 1).
I am using the DIPROPRANGE strucy with SetProperty to set the minimum
and maximum values of the axes (lMin and lMax properties) as explained
in the msdn example here:
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/directx9_c/directx/input/tuts/tut3/step4setjoystickbehavior.asp
Anyway, I now get a value between +/-60,000 on each axis - and then
divide it by 60,000 to get the unit circle values (so it basically
gives me a nice float value between -1 and 1).
Now, the problem is that the values change very drastically and tend to
snap to the 1/-1 values instead of giving me nice values in between.
What happens as a result is that when I move my analog stick in a
circular motion it basically jumps between 8 directions (top, top
right, right etc.)
instead of moving gradually between them.
I know this is probably something that would be very hard to trace
(could also be just cheap hardware), so I guess i'm just asking if
someone's exprienced something like this before?
Material on this subject on the net is very scarce...
Thanks!
Ehud.
I'm writing a game in c++ that's using directInput for gamepad support.
I want the right analog stick to be used as a unit circle (simply an x
& y vector between -1 and 1).
I am using the DIPROPRANGE strucy with SetProperty to set the minimum
and maximum values of the axes (lMin and lMax properties) as explained
in the msdn example here:
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/directx9_c/directx/input/tuts/tut3/step4setjoystickbehavior.asp
Anyway, I now get a value between +/-60,000 on each axis - and then
divide it by 60,000 to get the unit circle values (so it basically
gives me a nice float value between -1 and 1).
Now, the problem is that the values change very drastically and tend to
snap to the 1/-1 values instead of giving me nice values in between.
What happens as a result is that when I move my analog stick in a
circular motion it basically jumps between 8 directions (top, top
right, right etc.)
instead of moving gradually between them.
I know this is probably something that would be very hard to trace
(could also be just cheap hardware), so I guess i'm just asking if
someone's exprienced something like this before?
Material on this subject on the net is very scarce...
Thanks!
Ehud.