|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
I am using a rand generated value 'n' but the result is always the same. I've
put in a text trace to output the value 'n' as follows:
#declare R1 = seed(1);
#declare n = rand(R1);
//....//
text {
ttf "timrom.ttf" str(n,0,3) 0.3, 0
pigment { Red }
translate<0,2,0>
}
With the above seed the result is alwways 0.422. What am I missing here?
geo
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
geogeo wrote:
> I am using a rand generated value 'n' but the result is always the same. I've
> put in a text trace to output the value 'n' as follows:
>
> #declare R1 = seed(1);
> #declare n = rand(R1);
>
> //....//
> text {
> ttf "timrom.ttf" str(n,0,3) 0.3, 0
> pigment { Red }
> translate<0,2,0>
> }
>
> With the above seed the result is alwways 0.422. What am I missing here?
>
What you get with rand is a series of random numbers. Using the same
seed the series is always the same.
--
Best Regards,
Stephen
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> What you get with rand is a series of random numbers. Using the same
> seed the series is always the same.
That's an intentional design feature, if you place a bunch of objects
randomly with a certain seed, the image should still be exactly
reproducable on any machine running POV. Also, if you are
unhappy with the way a random placement pattern looks, you
can try another seed until you are happy with the placement,
and then be able to reproduce that same pattern in a final scene
with slower features like radiosity and photons turned on.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Tim Attwood" <tim### [at] anti-spamcomcastnet> wrote:
> > What you get with rand is a series of random numbers. Using the same
> > seed the series is always the same.
>
> That's an intentional design feature, if you place a bunch of objects
> randomly with a certain seed, the image should still be exactly
> reproducable on any machine running POV.
It's also of great practical use when making an animation--the seed() value,
being the same for every animation frame, produces the same rand() values per
frame. If it didn't, there would be chaos!
Ken
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Kenneth" <kdw### [at] earthlinknet> wrote:
> "Tim Attwood" <tim### [at] anti-spamcomcastnet> wrote:
> > > What you get with rand is a series of random numbers. Using the same
> > > seed the series is always the same.
> >
> > That's an intentional design feature, if you place a bunch of objects
> > randomly with a certain seed, the image should still be exactly
> > reproducable on any machine running POV.
>
> It's also of great practical use when making an animation--the seed() value,
> being the same for every animation frame, produces the same rand() values per
> frame. If it didn't, there would be chaos!
>
> Ken
Thanks Stephen, Tim, Kenneth for replies - which explains things.
So is there any way at all to produce a randomised number within POV?
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
geogeo <geo### [at] mecolcouk> wrote:
> I am using a rand generated value 'n' but the result is always the same. I've
> put in a text trace to output the value 'n' as follows:
> #declare R1 = seed(1);
> #declare n = rand(R1);
Well, you specified a seed of 1, and then you pull out a number from the
RNG stream. Of course you are going to get the next number in the stream
created with seed(1). That's by design.
> //....//
> text {
> ttf "timrom.ttf" str(n,0,3) 0.3, 0
> pigment { Red }
> translate<0,2,0>
> }
Btw, #debug exists for that exact purpose. Much easier to use.
--
- Warp
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Warp <war### [at] tagpovrayorg> wrote:
> geogeo <geo### [at] mecolcouk> wrote:
> > I am using a rand generated value 'n' but the result is always the same. I've
> > put in a text trace to output the value 'n' as follows:
>
> > #declare R1 = seed(1);
> > #declare n = rand(R1);
>
> Well, you specified a seed of 1, and then you pull out a number from the
> RNG stream. Of course you are going to get the next number in the stream
> created with seed(1). That's by design.
>
> > //....//
> > text {
> > ttf "timrom.ttf" str(n,0,3) 0.3, 0
> > pigment { Red }
> > translate<0,2,0>
> > }
>
> Btw, #debug exists for that exact purpose. Much easier to use.
>
> --
> - Warp
Thanks for info on #debug, had not noticed that feature, only been at this a few
days. But how do I get it to output variables? The following #debug fails:
#declare R1 = seed(1);
#declare n = rand(R1);
#debug "rand out = ",str(n),"\n";
thanks
Geo
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
geogeo <geo### [at] mecolcouk> wrote:
> Thanks for info on #debug, had not noticed that feature, only been at this a few
> days. But how do I get it to output variables? The following #debug fails:
> #declare R1 = seed(1);
> #declare n = rand(R1);
> #debug "rand out = ",str(n),"\n";
#debug takes one single string as parameter. To build a string made of
several components, you use the concat() function:
#debug concat("rand out = ", str(n, 0, -1), "\n")
--
- Warp
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Wasn't it geogeo who wrote:
>
>So is there any way at all to produce a randomised number within POV?
Some versions of MegaPOV had a tick_count variable which returns the
value of the computer's internal clock variable.
In official versions of POV, one thing you can do is pass an external
value into the scene with a command line "Declare" and use that value as
the seed. If you launch POV from a programming language that has access
to the computer's internal clock variable, you could pass that value
into the scene that way.
Another approach would be to store the seed in an external file. Read
the value with fopen and fread, use it as the seed for the current scene
then change the value (e.g. by adding 1) and write it back. That way,
the next time you run that scene you get a different seed value. That
also has the advantage that if you decide that the version of your scene
that you rendered three iterations ago had a particularly pretty random
pattern that you'd like to go back to, you can examine the file and work
out what the seed would have been.
--
Mike Williams
Gentleman of Leisure
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Warp <war### [at] tagpovrayorg> wrote:
> geogeo <geo### [at] mecolcouk> wrote:
> > Thanks for info on #debug, had not noticed that feature, only been at this a few
> > days. But how do I get it to output variables? The following #debug fails:
>
> > #declare R1 = seed(1);
> > #declare n = rand(R1);
> > #debug "rand out = ",str(n),"\n";
>
> #debug takes one single string as parameter. To build a string made of
> several components, you use the concat() function:
>
> #debug concat("rand out = ", str(n, 0, -1), "\n")
>
> --
> - Warp
Thanks for concat info - works fine now!
Geo
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |