![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Sorry if this sounds really stupid but I've looked around and got really
stuck. I was learning how to create macros and the sort and wanted to make
a variable, within a loop (ie x translation) be a random number, within
other languages it would be say xpoint = rand(10) and you'd get a number
between 0 and 10. According to the help file though I need a seed, which I
think I understand, but if used and placed within a loop makes all the
xpoints be of the same random number how can these be taken differently? If
I make no sense at all I can post the file with the prob, thanks
P3TE
--
pc### [at] WYSIWYGlineone net
remember dont use WYSISYG!
www.p3te.co.uk
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Peter Cracknell wrote:
>
> Sorry if this sounds really stupid but I've looked around and got really
> stuck. I was learning how to create macros and the sort and wanted to make
> a variable, within a loop (ie x translation) be a random number, within
> other languages it would be say xpoint = rand(10) and you'd get a number
> between 0 and 10. According to the help file though I need a seed, which I
> think I understand, but if used and placed within a loop makes all the
> xpoints be of the same random number how can these be taken differently? If
> I make no sense at all I can post the file with the prob, thanks
>
> P3TE
There is a great tutorial on using POV-Ray's rand() function at:
http://www.spake.org/rtimes/article/povindx.htm
--
Ken Tyler - 1300+ Povray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On Sun, 13 Feb 2000 21:15:26 -0000, "Peter Cracknell" <pc### [at] lineone net>
wrote:
>Sorry if this sounds really stupid but I've looked around and got really
>stuck. I was learning how to create macros and the sort and wanted to make
>a variable, within a loop (ie x translation) be a random number, within
>other languages it would be say xpoint = rand(10) and you'd get a number
>between 0 and 10. According to the help file though I need a seed, which I
>think I understand, but if used and placed within a loop makes all the
>xpoints be of the same random number how can these be taken differently? If
>I make no sense at all I can post the file with the prob, thanks
>
>P3TE
Make sure you don't initialise the seed withing the loop. Try
something like this:
#declare S = seed(1492);
union
{
#declare i=0;
#while (i<100)
sphere { 100*(<rand(S),rand(S),rand(S)>-0.5), 1 }
#declare i=i+1;
#end
pigment { Red }
}
Peter Popov
pet### [at] tag povray org
ICQ: 15002700
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |