|
|
Redbeard schrieb in Nachricht <3bf3299a$1@news.povray.org>...
>What I'm trying to achieve is to place an object within the space that some
>other object would occupy without intersecting previously placed objects.
As an
>example, imagine a simple snow-globe, a container with liquid and "snow"
>particles. Shake it up. The particles roughly fill the space, but no two
>intersect. This is what I want to do.
>
You could use trace() for this. To determine if a given place (get it by
using rand() f.e.) for a particle is already occupied by another particle,
you could trace() from the centre of that particle in "all" directions (the
more rays you shoot , the more accurate are your results) at the union of
the other particles. You'll get a bunch of intersection points. If all
intersection points are further away of the centre than the particle is
wide, you know that you can use that place. If not - try another one.
That's the way I would try it (never did, though).
Marc-Hendrik
Post a reply to this message
|
|