CGTalk > Software > Autodesk 3ds max > 3dsMax SDK and MaxScript
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 02-01-2009, 12:18 PM   #1
Rick Stirling
Veteran
Rick Stirling
Senior Artist/TD
Rockstar North
Edinburgh, United Kingdom
 
Join Date: Oct 2003
Posts: 95
Normalising joysticks - Xform?

For a while now I've had a joystick creation system that lets me link joystick sliders to bones (or anything else really) to control their rotation and translation.

This issue that I've always had is that the scale I have to work at is quite small so building a joystick that goes from -1 to +1 is massive on the screen - therefore I build all my joysticks so that they go from -0.05 to +0.05 and then normalise in my expressions or wiring.

I'm now thinking that this is a hack, and that I must be able to build them at that small scale, yet have them work as if they run from -1 to 1.

I'm at home rather than at work so I can't experiment, but I'm thinking that I might be able to construct the joystick (bounding box with circle and text) and then scale it with an Xform modifier. I'm sure someone will have ran into this issue before and can advise me if I'm heading in the right direction.
__________________
www.rsart.co.uk
 
Old 02-01-2009, 02:58 PM   #2
PEN
R&D/Technical Director
 
PEN's Avatar
portfolio
Paul Neale
PEN Productions
Canada
 
Join Date: Jun 2002
Posts: 7,415
Well it is possible to just scale them, the xform will not produce the result you are looking for as the control object will still travel a distance from -1 to 1. Scaling isn't optimal either as you just shouldn't do it. I would do what you have been doing and set up he math based on the size of the control. What you could do is have the auto creation setup a custom attribute that is driven by a script controller and does the normalization and then wire you bones to the custom attribute.
__________________
Paul Neale
http://paulneale.com
 
Old 02-01-2009, 05:15 PM   #3
eek
Fixer
 
eek's Avatar
portfolio
Charles Looker
Snr Technical Artist
Electronic Arts
Vancouver, Canada
 
Join Date: Feb 2002
Posts: 4,221
To put an interpolation into a value between 0 -1/-1 all you do is change you reference space. E.g If i want to get a value of 0-1 in a space of 10 - 20, you essentially make a ratio:

(t - 10) / ( 20-10) e.g (15- 10) = 5.0 and (20 - 10) = 10.0, 5.0/10.0 = 0.5 this will work back wards too:

(5-10) = -5 , (20 - 10) = 10, -5.0/ 10.0 = -0.5
__________________
Disclaimer: My opinions are not those of my employer.


 
Old 02-01-2009, 08:11 PM   #4
Rick Stirling
Veteran
Rick Stirling
Senior Artist/TD
Rockstar North
Edinburgh, United Kingdom
 
Join Date: Oct 2003
Posts: 95
Eek, the normalisation ratio is what I currently do - I calculate the size of the joystick and multiply that up for all the equations (truthfully I'm lazy and use 20 as the factor since I know it's always the same).

Paul, that's a *really* nice idea. I could build the joysticks as normal then script an intermediate normalisation layer. Hmm, I think I'll give that a try.

Thanks folks!
__________________
www.rsart.co.uk
 
Old 02-01-2009, 08:11 PM   #5
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,481
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 06:20 AM.


Powered by vBulletin
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.