POV-Ray : Newsgroups : povray.advanced-users : Random placement of objects : Re: Random placement of objects Server Time
26 Jun 2024 05:34:19 EDT (-0400)
  Re: Random placement of objects  
From: Alain
Date: 30 Aug 2013 17:15:34
Message: <52210b76$1@news.povray.org>

> I just played around a bit, since collision detection would be a nice thing. It
> seems that intersections of solid objects gives a finite bounding box if there
> is an intersection and an infinity one
>
> box { <-10000000000,10000000000> }
>
> if there is no intersection. May be one of the more experienced users here knows
> the answer. It seems to work with spheres and boxes.
>
> But one has to store all objects in an Array since one has to test every new one
> against all existing. In special cases there are optimisations. May be you would
> like to study the code of Jonathan Hunts "pebbles". You find the link within the
> POV Hall of Fame.
>
> Best regards,
> Michael
>
>
>
A simple one is to put all base objects in a single union. Those are 
your environment.

Test the randomly placed objects against that union.

If you have many objects to place, after about 100, make an union with 
those. Now, you only test for the static objects and that union. That 
test will be much faster than testing every individual objects.

You can also use the trace function in some cases.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.