|
-
Jul 2nd, 2002, 06:05 PM
#1
I need some randomness
if I use srand(time(NULL)) in my initialize portion of my project (OGL, by the way), and then use rand() blah blah blah to get random colors on some QUADS I'm using they turn out the same color everytime. It like I'm seeding the generator with the same number each time. I thought time(NULL) would be the time past midnight in millis. Am I wrong?
Thanks, NOMAD
-
Jul 10th, 2002, 07:15 PM
#2
no, time() is the seconds since
00-00-1970 00:00:00
only seed the generator once: call srand at the start of your app and never again
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|