WorldViz User Forum G25 steering wheel range !
 Register FAQ Search Today's Posts Mark Forums Read

#1
03-27-2010, 03:15 AM
 moneim230 Member Join Date: Oct 2009 Posts: 18
G25 steering wheel range !

Hello all,

I'm using the G25 steering wheel which has 900 degrees steering range (450 to the right and 450 to the left).

I use vizjoy.getPosition() to get the value of steering, the value comes on X.

The problem is that i get "-1" for 90 degrees to the left and "1" for 90 degrees to the right, I need to get the full range (900 degrees). How can i scale it ??
#2
03-28-2010, 06:04 AM
 dwaik Member Join Date: Feb 2010 Posts: 26
here you dont want to scale first, you need to get the full range [-5,5] if you can get it,
then you can use the mathmatical range scaling which:

to scale x form range [a-b] to range [c-d]

newX=(x-a)/(b-a) #here you will have your value in range [0-1]
finalValue=(newX*(d-c))+c #and here you will have your value in range [c-d]

which in your case if x was 2 in range [-5,5] and you need to change it to range [-450,450]

you can solve it as follows:
newX=(2-(-5))/(5-(-5)) #7/10=0.7 in range [0,1]
finalValue=(0.7*(450-(-450)))+(-450) #(0.7*900)-450=180 and thats it

hope that helps
#3
03-28-2010, 03:54 PM
 moneim230 Member Join Date: Oct 2009 Posts: 18
Quote:
 Originally Posted by dwaik here you dont want to scale first, you need to get the full range [-5,5] if you can get it, then you can use the mathmatical range scaling which: to scale x form range [a-b] to range [c-d] newX=(x-a)/(b-a) #here you will have your value in range [0-1] finalValue=(newX*(d-c))+c #and here you will have your value in range [c-d] which in your case if x was 2 in range [-5,5] and you need to change it to range [-450,450] you can solve it as follows: newX=(2-(-5))/(5-(-5)) #7/10=0.7 in range [0,1] finalValue=(0.7*(450-(-450)))+(-450) #(0.7*900)-450=180 and thats it hope that helps
unfortunately it didn't work.....the G25 has 900 degrees of rotation, when running games, you can freely steer it through the whole 900 degrees, but in Vizard it is freely to steer it only to +90 or -90, outside this range the wheel feedback works (you can continue steering but you'll feel a force in the opp. direction + nothing happens in vizard after steering more than 90).

therefore, in the scaling equation you wrote, finalValue is 90 max when steering right and -90 for steering left

 Thread Tools Display Modes Rate This Thread Linear Mode Rate This Thread: 5 : Excellent 4 : Good 3 : Average 2 : Bad 1 : Terrible

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Announcements Vizard Precision Position Tracker (PPT) Plug-in development

 Similar Threads Thread Thread Starter Forum Replies Last Post Vic Precision Position Tracker (PPT) 2 06-11-2009 06:19 AM fuyonggang Vizard 4 12-18-2008 06:14 PM theuberk Vizard 4 07-30-2007 09:31 AM sled Vizard 6 08-01-2003 10:03 PM sled Vizard 2 07-16-2003 04:18 PM

All times are GMT -7. The time now is 05:38 PM.