POV-Ray : Newsgroups : povray.advanced-users : Need help with rand/seed Server Time
26 Nov 2024 17:20:02 EST (-0500)
  Need help with rand/seed (Message 11 to 18 of 18)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: CreeD
Subject: Re: Need help with rand/seed
Date: 13 Jul 2000 17:36:06
Message: <01bfed13$18efe640$1a1ba1d0@mk>
Thanks to both who replied.

Chris -
Sorry to sound overly whiny about the documentation.  Please don't take my
comments on it personally if you had a hand in creating it.  I don't have
any particular aversion to programming terms, and I'm sure I'll pick them
up over time (or be forced to actively seek to learn them).  

	Still, I feel that the latter bit of writing that you insist is only
'different, but not better' than the documentation -IS- better.  If the
documentation is being done well, it balances 
A.The need to get the point across clearly and concisely and 
B: The writer's need to sleep.
	
	I'm not a dumb guy.  The way you explained in your most recent post got
through and the way it was explained in the documentation didn't.  That
tells me one is better than the other, even if I couldn't absolutely prove
it (or even put out a halfway decent argument as to why).  
 
  To answer your question -
if I were writing it, I'd say that seed exists only for the user to provide
POV with his own truly random starting point, and from that point POV
always extracts a random number between 0 and 1 <italics> regardless of the
seed number </italics>. 
	 Then I'd point out  (as you did), that to get random numbers larger than
1 requires addition or multiplication of the number POV returns.  I'd also
stress (as you did) that with identical conditions, the number produced is
always the same. 
	
Maybe these three points hit home immediately for everyone else but me -
shrug.


Post a reply to this message

From: Mark James Lewin
Subject: Re: Need help with rand/seed
Date: 13 Jul 2000 18:06:47
Message: <396E3B1D.A49A5493@yahoo.com.au>
If you want a truly random number that you want to save once you get a result
you like, you could try something like this...

#declare MySeedValue = tick_count;

#declare MySeed = seed(MySeedValue)

#declare MyRandom = rand(MySeed)

#fopen MyFile "c:\MyFile.txt" write
#write (MyFile,MySeedValue)
#fclose MyFile

That way, you can then look at MyFile so see the seed value you have used, then
to repeat the code exactly change so that...

#declare MySeedValue = 15000;

or whatever the value in MyFile was.

tick_count assumes you have MegaPov, of course.

MJL


Post a reply to this message

From: CreeD
Subject: Re: Need help with rand/seed
Date: 13 Jul 2000 23:47:22
Message: <01bfed46$f81e6b60$e81ba1d0@mk>
> If you want a truly random number that you want to save once you get a
result
> you like, you could try something like this...
> 
> #declare MySeedValue = tick_count;
> 
> #declare MySeed = seed(MySeedValue)
> 
> #declare MyRandom = rand(MySeed)
> 
> #fopen MyFile "c:\MyFile.txt" write
> #write (MyFile,MySeedValue)
> #fclose MyFile
> 
> That way, you can then look at MyFile so see the seed value you have
used, then
> to repeat the code exactly change so that...
> 
> #declare MySeedValue = 15000;
> 
> or whatever the value in MyFile was.
> 
> tick_count assumes you have MegaPov, of course.

That's a very useful tip .. I wasn't aware of #write. 
So far I've got a random vase generator that works pretty well.
If I can get it to write the seeds I used I can render the ones I like at a
decent resolution, although 5-6 minutes is bearable as it is at 512x384...
anyway, thanks much.


Post a reply to this message

From: Mark James Lewin
Subject: Re: Need help with rand/seed
Date: 14 Jul 2000 02:20:32
Message: <396EAECD.CCA7D6AD@yahoo.com.au>
Don't forget that POV will not place anything in between it's output unless you
tell it so. eg the numbers 12, 18, and 5 will appear as 12185 in your output
unless you do something like this...

#write (SeedValue1," ",SeedValue2," ")

etc. which will put spaces between them. You get the picture. Stick with the
pov manual, and constantly look it up. It really is handy. Within weeks, it'll
become your most used help file, I guarantee.

MJL

MJL

CreeD wrote:

> > If you want a truly random number that you want to save once you get a
> result
> > you like, you could try something like this...
> >
> > #declare MySeedValue = tick_count;
> >
> > #declare MySeed = seed(MySeedValue)
> >
> > #declare MyRandom = rand(MySeed)
> >
> > #fopen MyFile "c:\MyFile.txt" write
> > #write (MyFile,MySeedValue)
> > #fclose MyFile
> >
> > That way, you can then look at MyFile so see the seed value you have
> used, then
> > to repeat the code exactly change so that...
> >
> > #declare MySeedValue = 15000;
> >
> > or whatever the value in MyFile was.
> >
> > tick_count assumes you have MegaPov, of course.
>
> That's a very useful tip .. I wasn't aware of #write.
> So far I've got a random vase generator that works pretty well.
> If I can get it to write the seeds I used I can render the ones I like at a
> decent resolution, although 5-6 minutes is bearable as it is at 512x384...
> anyway, thanks much.


Post a reply to this message

From: Mark James Lewin
Subject: Re: Need help with rand/seed
Date: 14 Jul 2000 02:23:53
Message: <396EAF98.82C6834B@yahoo.com.au>
Oops, I meant...

#write (MyFile,SeedValue1," ",SeedValue2," ")

sorry.

MJL

Mark James Lewin wrote:

> Don't forget that POV will not place anything in between it's output unless you
> tell it so. eg the numbers 12, 18, and 5 will appear as 12185 in your output
> unless you do something like this...
>
> #write (SeedValue1," ",SeedValue2," ")
>
> etc. which will put spaces between them. You get the picture. Stick with the
> pov manual, and constantly look it up. It really is handy. Within weeks, it'll
> become your most used help file, I guarantee.
>
> MJL
>
> MJL
>
> CreeD wrote:
>
> > > If you want a truly random number that you want to save once you get a
> > result
> > > you like, you could try something like this...
> > >
> > > #declare MySeedValue = tick_count;
> > >
> > > #declare MySeed = seed(MySeedValue)
> > >
> > > #declare MyRandom = rand(MySeed)
> > >
> > > #fopen MyFile "c:\MyFile.txt" write
> > > #write (MyFile,MySeedValue)
> > > #fclose MyFile
> > >
> > > That way, you can then look at MyFile so see the seed value you have
> > used, then
> > > to repeat the code exactly change so that...
> > >
> > > #declare MySeedValue = 15000;
> > >
> > > or whatever the value in MyFile was.
> > >
> > > tick_count assumes you have MegaPov, of course.
> >
> > That's a very useful tip .. I wasn't aware of #write.
> > So far I've got a random vase generator that works pretty well.
> > If I can get it to write the seeds I used I can render the ones I like at a
> > decent resolution, although 5-6 minutes is bearable as it is at 512x384...
> > anyway, thanks much.


Post a reply to this message

From: Chris Huff
Subject: Re: Need help with rand/seed
Date: 14 Jul 2000 16:43:55
Message: <chrishuff-94F1F7.15441914072000@news.povray.org>
In article <01bfed13$18efe640$1a1ba1d0@mk>, "CreeD" <meshe@nqi.net> 
wrote:

> Sorry to sound overly whiny about the documentation.  Please don't 
> take my comments on it personally if you had a hand in creating it.  

Don't worry, I wasn't taking it personally...and this portion of the 
documentation probably existed long before I had ever heard of POV.


> I don't have any particular aversion to programming terms, and I'm 
> sure I'll pick them up over time (or be forced to actively seek to 
> learn them).  
> 
> 	Still, I feel that the latter bit of writing that you insist is only
> 'different, but not better' than the documentation -IS- better.  If the
> documentation is being done well, it balances 
> A.The need to get the point across clearly and concisely and 
> B: The writer's need to sleep.

Actually, I thought my description was repetitive, a bit imprecise in 
areas, as well as very long-winded, and highly redundant in areas(almost 
as redundant as the adjectives I am using to describe it in this 
sentence). :-)
If I really wanted to explain this at such a basic level, I would draw 
pictures and make an HTML document...and if this was done for the whole 
manual...

Anyway...when you are looking for this kind of information, and you know 
the terminology, this kind of long-winded explanation is a burden, not a 
help. Imagine having to wade through pages of useless information to 
find one little piece of information ("The numbers are uniformly 
distributed, and have values between 0.0  and 1.0, inclusively.", for 
example). My bit of writing might have been better for a dedicated 
tutorial, but this is a basic language reference.

For the people who need help understanding this type of thing, there is 
all the information you need on these newsgroups, in sample scenes, or 
on the web. You just have to listen, and try to understand the 
terminology...most of it is quite logical once you understand *why* a 
term is used. It isn't some magical capability you are born with or need 
to study books to learn. (Though books can help...unfortunately, I can't 
afford many. :-( )

-- 
Christopher James Huff - Personal e-mail: chr### [at] maccom
TAG(Technical Assistance Group) e-mail: chr### [at] tagpovrayorg
Personal Web page: http://homepage.mac.com/chrishuff/
TAG Web page: http://tag.povray.org/


Post a reply to this message

From: Bob Hughes
Subject: Re: Need help with rand/seed
Date: 14 Jul 2000 20:28:44
Message: <396fb03c@news.povray.org>
"Mark James Lewin" <m_j### [at] yahoocomau> wrote in message
news:396EAF98.82C6834B@yahoo.com.au...
| Oops, I meant...
|
| #write (MyFile,SeedValue1," ",SeedValue2," ")
|
| sorry.

Spaces won't work (I don't think so anyway), you need commas inside those quotes.  The
way POV will
use #read when you are wanting the data back from the file is to delimit (separate)
based on the
commas.  You still need to use those commas you already show there though to separate
the
parameters too.

Bob


Post a reply to this message

From: Mark James Lewin
Subject: Re: Need help with rand/seed
Date: 16 Jul 2000 20:04:54
Message: <39724B3C.CF48AFC4@yahoo.com.au>
I know (I ran into the trouble of non delimited input files when I first started using
POV). But pov
can _write_ spaces, and if you are just generating rands until you get one (or
several) you like,
copy...paste, is easier that #fopen...#read...#fclose. Spaces will let you know when
one number ends
and the next begins.

MJL

Bob Hughes wrote:

> "Mark James Lewin" <m_j### [at] yahoocomau> wrote in message
news:396EAF98.82C6834B@yahoo.com.au...
> | Oops, I meant...
> |
> | #write (MyFile,SeedValue1," ",SeedValue2," ")
> |
> | sorry.
>
> Spaces won't work (I don't think so anyway), you need commas inside those quotes. 
The way POV will
> use #read when you are wanting the data back from the file is to delimit (separate)
based on the
> commas.  You still need to use those commas you already show there though to
separate the
> parameters too.
>
> Bob


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.