Previous Thread
Next Thread
Print Thread
Rate This Thread
Hop To
#3398107 - 09/26/11 09:16 PM Centering a relative mapped Axis  
Joined: Jun 2008
Posts: 7
Madog Offline
Junior Member
Madog  Offline
Junior Member

Joined: Jun 2008
Posts: 7
Hey, i'm using
MapKey(&Joystick, S4, EXEC("MapAxis(&Throttle, SCX, DX_SLIDER_AXIS, AXIS_NORMAL, MAP_RELATIVE);
SetSCurve(&Throttle, SCX, 0, 10, 0, 4, -10);
MapAxis(&Throttle, SCY, DX_THROTTLE_AXIS, AXIS_NORMAL, MAP_RELATIVE);
SetSCurve(&Throttle, SCY, 0, 10, 0, 4, -10);")
);
MapKeyR(&Joystick, S4, EXEC("MapAxis(&Throttle, SCX, DX_XROT_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
SetSCurve(&Throttle, SCX, 0, 0, 0, 0, 0);
MapAxis(&Throttle, SCY, DX_YROT_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
SetSCurve(&Throttle, SCY, 0, 0, 0, 0, 0);")
);
to toggle between ABSOLUTE mapped axis for the cursors, etc. and RELATIVE mapped axis for view control. My problem is this: i am not able to force the RELATIVE mapped axis to center, effectively centering the view.

Does someone know how center an relative mapped axis?

Thanks in advance,

Madog

Inline advert (2nd and 3rd post)

#3398122 - 09/26/11 09:29 PM Re: Centering a relative mapped Axis [Re: Madog]  
Joined: Jun 2008
Posts: 7
Madog Offline
Junior Member
Madog  Offline
Junior Member

Joined: Jun 2008
Posts: 7
Nevermind, wrote my own centering function, works like a charm:

int CenterAxis(alias o, int x, int index)
{
if(!GetAxisData(&o, x)) return 0;
DXSetAxis(index, 0);
axdata.relpos = 0;
}
MapKey(&Throttle, SC, CHAIN(EXEC("CenterAxis(&Throttle, SCX, DX_SLIDER_AXIS);"), EXEC("CenterAxis(&Throttle, SCY, DX_THROTTLE_AXIS);")));

Last edited by Madog; 09/27/11 01:17 PM.

Moderated by  RacerGT 

Quick Search
Recent Articles
Support SimHQ

If you shop on Amazon use this Amazon link to support SimHQ
.
Social


Recent Topics
solar eclipse thoughts
by jroc. 08/21/17 10:17 PM
Hunting the mountain gold
by EAF331 MadDog. 08/21/17 08:46 PM
Forget Bonnie Tyler...
by WangoTango. 08/21/17 05:32 PM
Downloading YT videos
by - Ice. 08/21/17 02:01 PM
Who has seen Alien: Covenant? **spoilers**
by PanzerMeyer. 08/21/17 10:47 AM
Coal fire on the Titanic
by oldgrognard. 08/20/17 09:28 PM
Jerry Lewis was 91
by F4UDash4. 08/20/17 06:03 PM
Every once in awhile, I watch this video...
by Li'lJugs. 08/19/17 08:36 PM
USS Indianapolis (CA-35) Located
by F4UDash4. 08/19/17 04:52 PM
Spain and Catalonia (Holiday)
by Alicatt. 08/18/17 11:03 AM
Copyright 1997-2016, SimHQ Inc. All Rights Reserved.

Powered by UBB.threads™ PHP Forum Software 7.6.0