POV-Ray : Newsgroups : povray.general : how to prevent overlapping random objects? : Re: how to prevent overlapping random objects? Server Time
30 Jul 2024 02:28:47 EDT (-0400)
  Re: how to prevent overlapping random objects?  
From: Ray Gardener
Date: 27 Aug 2010 13:26:39
Message: <4c77f54f$1@news.povray.org>
There are two simple methods I use:

1) Use regular grid positions with random perturbation offsets.
    You can guarantee non-overlap by simply making the offset range
    less than the grid spacing. This works better for objects of
    similar size.

2) Use a mask bitmap (stencil). This takes more memory and more coding,
    but basically you record the placement of objects in the mask, and
    then consult the mask when placing more objects. Fortunately, the
    mask only needs to be 1-bit per pixel.

Ray


Post a reply to this message

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