Maya for 3D Printing - Rapid Prototyping
In this course we're going to look at something a little different, creating technically accurate 3D printed parts.
# 1 18-06-2012 , 02:11 PM
Sircharles's Avatar
Registered User
Join Date: Dec 2010
Location: Uk
Posts: 193

Random number

Hi Id like to be able to create an expression to generate a number between 100 - 200

and use it in the magnitude slot of my wind field?

But I've never really done expressions..

Anyone know how?

# 3 18-06-2012 , 03:48 PM
NextDesign's Avatar
Technical Director
Join Date: Feb 2004
Posts: 2,988
Simple:

windField.magnitude = rand(100, 200);


Imagination is more important than knowledge.
# 4 18-06-2012 , 03:50 PM
EduSciVis-er
Join Date: Dec 2005
Location: Toronto
Posts: 3,374
Just to be clear though, as far as I know, this will cause the magnitude of the wind to be a random strength on each and every frame of your animation, which might give strange results.

# 5 18-06-2012 , 04:58 PM
Sircharles's Avatar
Registered User
Join Date: Dec 2010
Location: Uk
Posts: 193
sweet, would there be a way to control the amount of times it changes.

For example 4 times or 10 times over a period of 10secs for instance?

# 6 18-06-2012 , 05:03 PM
EduSciVis-er
Join Date: Dec 2005
Location: Toronto
Posts: 3,374
Does it have to be different every time? Honestly I would just pick a few "random" values and key the magnitude over time. Then you'll get smooth transitions and it will still appear random.

# 7 18-06-2012 , 07:49 PM
Sircharles's Avatar
Registered User
Join Date: Dec 2010
Location: Uk
Posts: 193
Yup I suppose. thanks.

# 8 18-06-2012 , 08:22 PM
PixalZA's Avatar
Lifetime Member
Join Date: May 2011
Location: Riyadh, Saudi Arabia
Posts: 525


Earth: The crazy asylum of the universe.
# 9 19-06-2012 , 01:04 PM
Sircharles's Avatar
Registered User
Join Date: Dec 2010
Location: Uk
Posts: 193
Interesting, thanks.

# 10 19-06-2012 , 03:22 PM
NextDesign's Avatar
Technical Director
Join Date: Feb 2004
Posts: 2,988
Just in case you're using nCloth, it has wind built in.


Imagination is more important than knowledge.
Posting Rules Forum 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

Similar Threads