Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Joystick Calibration

Author
Message
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 24th Jan 2005 12:29
I've been playing with the joystick controls tonight, just trying to sort out a nice little demo that I can use my new gamepad with.

There are alot of indescrypencies in how they process back the information.

For me the Twist Z = Z Rotation, which I suppse makes sense however what doesn't make sense is the fact that it goes from 0 to 65535 rather than -1000 to 1000 like the others.

This is meaning that making an automatic calibration program a pain in the ass, because I now don't know what all of the other values are *suppose* to be.

As the help doesn't actually cover how any of the data is actually processed past what is given back, I am a little warey to continue.
What confuses me more is that DirectX itself works -1000 to 1000 for the joystick Axis / Rotation itself, it is only the POV Hats (which the Joystick D-Pas is considered to be) work differently.

Something else confusing is that DirectX only supports 2 Sliders, so why does DarkBASIC Professional support 4?

sniper
20
Years of Service
User Offline
Joined: 3rd Dec 2004
Location:
Posted: 24th Jan 2005 23:59
?

king chris www.digitalmind-creations.websiteallies.com
Tapewormz
22
Years of Service
User Offline
Joined: 15th Sep 2002
Location: Winnipeg, Mantoba, Canada
Posted: 25th Jan 2005 09:27 Edited at: 25th Jan 2005 09:28
Just come up with a formula that converts it to -1000 to 1000. That's easy enough.

Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 25th Jan 2005 17:43
Quote: "Just come up with a formula that converts it to -1000 to 1000. That's easy enough."
]

Which would be all well and good, IF I was CERTAIN of what everything is. The help doesn't mention how the values are stored and I've already come across 3 different value types, so if someone uses a Joypad/JoyStick that works differently to the one I have then really I don't know how the hell I'm suppose to convert the other values.

I really am trying to get my head around why I should have to in the first place, given DirectX itself works to the exact same damn values for everything.

Something else peeculiar is that in DBP my joypad is offset -8,-8,-8 on the AxisXY RotZ however in the Windows Calibration Program and in the DirectX Example program, these values are 0.

I need to have some was of knowing what is going on really, and as I said the help is about as helpful as magnesium water chair!

Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 25th Jan 2005 21:06
I'd forget any scaling on your joystick, make your own calibration system that converts everything into an array. For instance, tell the user to leave the joystick alone and grab the centre values, then ask the player to move everything on the joystick to it's extents, and keep track of the minimum and maximum values returned for each control.

Then make a function to convert this data into a recognisable format, like maybe percentages - then you'd dampen the output so low percentages are ignored.


Van-B


It's c**p being the only coder in the village.
heartbone
22
Years of Service
User Offline
Joined: 9th Nov 2002
Location:
Posted: 25th Jan 2005 21:46
If you have 2 joypads/joysticks Raven, I may have something for you to test your pads with.

Peace, the anti-Bush.
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 26th Jan 2005 00:46
Yeah, I've a few joysticks/joypads Heartbone.. might be picking up a second Gameware one, cause they're only £5 at the moment. Seems a very good controller, apart from the fact it can't use Force Water. Anyone know if it is suppose to work?

Yeah Van, I know what you mean. Just seems over-complex for some reason.
I mean if you think about it, if some value goes from Signed Integers (-128 to 127) and some go from Unsigned Integers (0 to 256 ) .. then the complex issue creeps in, how the heck do I make a routine that is capable of figuring out which is being used? Especially if during the calibration process the controller isn't leveling correctly at 0 or 127?

What is more annoying is the fact the joypad is offsetting where'as every other DirectX application it isn't. The joypad should be calibrated externally of the program an not need an internal one, so I'm kinda curious to why I do need to in DBP?

Login to post a reply

Server time is: 2025-05-31 00:35:09
Your offset time is: 2025-05-31 00:35:09