|
![](/i/fill.gif) |
"JRG" <jrg### [at] hotmail com> schrieb im Newsbeitrag news:3cbc95a6@news.povray.org...
> "Jan Walzer" wrote:
> > But also small translation (or jittering) of the sphere would involve
> > a complete check of all other spheres if I don't do anything else...
> > Maybe I could (after I detected some collisions) save the nearest ones
> > and only check these ones ...
>
> Usually jittering is done in such way to make it impossible to have intersections.
> That would make it a O(0)... ;-)
> If R is the radius of the sphere you're placing and 1/L^2 is the density you want to
> get (x_step=L, z_step=L) then you can translate your sphere by L/2-R maximum in any
> direction. That should prevent any intersection, and yet make it possible to have
> spheres touching each other.
> Of course L>=2*max(Ri)i=1,2,...n.
lets see, if I understood this correct ...
You say, that I should first place all the spheres in a grid, and then jitter this
to make a random distribution ? ... sounds interesting ...
My current approach is, that I select a random point in the area, and compute
the size of the sphere (currently the size of the sphere depends from a function, so
I have a bit control about the size)...
Then I look through an array of the already positioned spheres and if there's
another sphere intersecting, then I look for another place ...
> > But I found a problem in my other approach. Does POV-Ray support some-
> > thing like chained-lists efficiently ? I don't know, how to find out,
> > if I have a given box, which of my thousands spheres are in that very
> > one box.
>
> I did it once. IIRC it was a real puzzle, I began to meet arrays in my not so quiet
> dreams... :-|
that doesn't sound nice ... you mean I should leave this to an external program ?
Post a reply to this message
|
![](/i/fill.gif) |