|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Hello,
For the current project I'm working on (see post 'More mushies' in p.b.i),
I've put a lot of small mushrooms around the base of some larger ones. This
was done using a while loop to place them all randomly. The problem is, some
of them intersect with the stems of the larger mushrooms and also with
themselves. Can anyone here suggest a way to place them (semi) randomly
without this happening?
Thanks,
Ryan Twitchell
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
I don't know yet if it can be done with some of Povray's new features, but
what you might try is using your #while loop to build an #array, then have
it check each new value against the previous array values, then try again if
it is within a range of any previous number.
"Ryan Twitchell" <try### [at] rochesterrrcom> wrote in message
news:3868e6b4@news.povray.org...
> Hello,
> For the current project I'm working on (see post 'More mushies' in
p.b.i),
> I've put a lot of small mushrooms around the base of some larger ones.
This
> was done using a while loop to place them all randomly. The problem is,
some
> of them intersect with the stems of the larger mushrooms and also with
> themselves. Can anyone here suggest a way to place them (semi) randomly
> without this happening?
>
> Thanks,
> Ryan Twitchell
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
I just put a scene that's doing something like this in text.scene-files. It's
not fully tested but it seems to work.
I hope this helps.
G.
Ryan Twitchell wrote:
> Hello,
> For the current project I'm working on (see post 'More mushies' in p.b.i),
> I've put a lot of small mushrooms around the base of some larger ones. This
> was done using a while loop to place them all randomly. The problem is, some
> of them intersect with the stems of the larger mushrooms and also with
> themselves. Can anyone here suggest a way to place them (semi) randomly
> without this happening?
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
I had a similar type of problem with a tray of glass marbles. When pov 3.1 and arrays
arrived I solved the problem with a pair of nested #while loops. The outer loop
generated
a random position in the current element of the array, and the 2nd loop checked that
previous entries were more than one diameter away. An OK entry allowed the outer loop
to
increment.
Can't find my old source right now but will have another look if you don't get a
response.
Alf
http://www.peake42.freeserve.co.uk
http://ourworld.compuserve.com/homepages/Alf_Peake/
Ryan Twitchell <try### [at] rochesterrrcom> wrote in message
news:3868e6b4@news.povray.org...
> Hello,
> For the current project I'm working on (see post 'More mushies' in p.b.i),
> I've put a lot of small mushrooms around the base of some larger ones. This
> was done using a while loop to place them all randomly. The problem is, some
> of them intersect with the stems of the larger mushrooms and also with
> themselves. Can anyone here suggest a way to place them (semi) randomly
> without this happening?
>
> Thanks,
> Ryan Twitchell
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Alf Peake" <alf### [at] peake42freeservecouk> wrote in message
news:386d0131@news.povray.org...
> I had a similar type of problem with a tray of glass marbles. When pov 3.1
and arrays
> arrived I solved the problem with a pair of nested #while loops. The outer
loop generated
> a random position in the current element of the array, and the 2nd loop
checked that
> previous entries were more than one diameter away. An OK entry allowed the
outer loop to
> increment.
> Can't find my old source right now but will have another look if you don't
get a response.
>
I played with this and although my debug statements seem to say that it
was working, I still got some coincident placements. I would like to see how
you did it, I must be overlooking something obvious. It seems like a simple
thing.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
In article <386d3e73@news.povray.org>, "Bill DeWitt"
<the### [at] earthlinknet> wrote:
> I played with this and although my debug statements seem to say that
> it
> was working, I still got some coincident placements. I would like to see
> how
> you did it, I must be overlooking something obvious. It seems like a
> simple thing.
Hmm, make sure to check for 1 diameter(double the radius) instead of the
radius. This can be easy to miss.
--
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Chris Huff" <chr### [at] yahoocom> wrote :
>
> Hmm, make sure to check for 1 diameter(double the radius) instead of the
> radius. This can be easy to miss.
>
<chuckle> I did actually miss this to begin with, but it was the first
thing I fixed. I haven't really put that much time into it yet, and I
usually need solid blocks of time to get anything right. I am too scattered
to keep track of where I was otherwise.
Basically I am building an array in a loop, and inside the loop I
re-check the previous entries and keep choosing new values until I get one
that doesn't match any of the previous ones... should be simple enough, I
have done the same thing before in making card games in BASIC and C... I
just need to sit down and work on it till it's fixed...
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Bill, I decided its easier to re-invent than look for it at the moment so have just
posted
Random object placement in pov.t.s-f
There's plenty of scope to play about with it.
Alf
Bill DeWitt <the### [at] earthlinknet> wrote in message
news:386d3e73@news.povray.org...
>
> "Alf Peake" <alf### [at] peake42freeservecouk> wrote in message
> news:386d0131@news.povray.org...
> > I had a similar type of problem with a tray of glass marbles. When pov 3.1
> <cut>
>
> I played with this and although my debug statements seem to say that it
> was working, I still got some coincident placements. I would like to see how
> you did it, I must be overlooking something obvious. It seems like a simple
> thing.
>
>
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Alf Peake" <alf### [at] peake42freeservecouk> wrote :
>
> Bill, I decided its easier to re-invent than look for it at the moment so
have just posted
> Random object placement in pov.t.s-f
> There's plenty of scope to play about with it.
>
Yeah! Pretty cool. Good Idea about that red/green status hoop thingie...
I'm still trying to find time to work on mine, but yours works very much
like what I am trying to do.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |