|
![](/i/fill.gif) |
I have this object that uses a whole bunch of random values, but it seems
that every time I run the scene, it looks exactly the same. Here's the
relevent code (since regular inequality signs won't work in web view here, I
am replacing them in this message with [ and ]):
#declare Conifer_Cluster =
union
{
#declare numNeedles = 5 + rand(seed(12))*5;
#declare iter = 0;
#while(iter [ numNeedles)
object { Conifer_Needle rotate
[rand(seed(iter))*80,0,rand(seed(iter))*80] }
#declare iter = iter+1;
#end
rotate [-40,0,-40]
rotate [90,0,0]
}
This is to generate a cluster of pine needles. The object referred to in the
code called "Conifer_Needle" is just a simple slender cylinder. Every time
I run this, there are exactly 5 needles created and they are always in the
same position. So I'm not getting some aspect of the random number
generation in POV-Ray... What do I need to do to get different results each
time? The reason it needs to be different is that later on I am going to
have another object that will refer to this object within a #while loop.
Post a reply to this message
|
![](/i/fill.gif) |