random number [0, 1]

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
Post Reply
levan
Halfling
Posts: 41
Joined: Sun Oct 27, 2013 11:57 pm
x 1

random number [0, 1]

Post by levan »

Hello

I need to generate random number between 0 and 1. like 0.121, 0.576 etc. Which method is doing that ??

Ogre::Math::UnitRandom();
Ogre::Math::RandomValueProvider::getRandom();

or some other ?


best

levan
User avatar
tod
Troll
Posts: 1394
Joined: Wed Aug 02, 2006 9:41 am
Location: Bucharest
x 94
Contact:

Re: random number [0, 1]

Post by tod »

You sure do have a lot of questions. You do know there is a manual, a wiki, and the Ogre sources? Just in case I'm not around. :wink:
Click the above link for the answer, and a chance to win valuable insight!!!
User avatar
Herb
Orc
Posts: 412
Joined: Thu Jun 04, 2009 3:21 am
Location: Kalamazoo,MI
x 38

Re: random number [0, 1]

Post by Herb »

From the ogre3d Manual:

Code: Select all

static Real Ogre::Math::RangeRandom(Real fLow, Real fHigh )		
Generate a random number within the range provided.

Parameters
fLow The lower bound of the range.
fHigh The upper bound of the range.
Returns
A random number in the range from [fLow,fHigh].
Post Reply