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.

Newcomers DBPro Corner / How on earth is this meant to work??

Author
Message
Gibbon
19
Years of Service
User Offline
Joined: 12th Mar 2005
Location:
Posted: 12th Mar 2005 09:31
Ok, a raw input from the 'slider' on a joystick, after deviding the number down, its range is from 5 - 32 and centered at around 15, so...thats ok, but i want it so when slider is one way it turns a object around 1 way and the other way will turn the object the other? BUT how can i do this..its FINE for one way (values go up) and as i wasnt it, the object turns and the more you go that way the more it turns! no...for the oter way..its fine..but the more you turn the LESS it turns as your LOWERING the value? How can i overcome this problem?
Thanks
Andy
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 12th Mar 2005 19:15
First, subtract 19. This will give you a value from -14 to + 14.

You can detect one direction from the other by checking <> 0.

You can detect how much turn to apply by using ABS(value).

ABS turns all values into positive, so will always get a value of 0 to 14.

Hope that makes sense.

BatVink
Gibbon
19
Years of Service
User Offline
Joined: 12th Mar 2005
Location:
Posted: 12th Mar 2005 19:35
Brilliant, i new there was an easy answer!!

Thank you
Andy

Login to post a reply

Server time is: 2024-11-13 19:58:03
Your offset time is: 2024-11-13 19:58:03