POV-Ray : Newsgroups : povray.general : Algorithm-approach to eliminate intersections... : Re: Algorithm-approach to eliminate intersections... Server Time
6 Aug 2024 08:13:00 EDT (-0400)
  Re: Algorithm-approach to eliminate intersections...  
From: Tim Nikias
Date: 22 Jun 2002 07:22:41
Message: <3D145E02.E3826D7F@gmx.de>
You're system keeps track of how much of the ground
is occupied. Its a neat idea, though when combined with
slopes, its hard to predict how much space you actually
have availabe.

But I'll keep it in mind for future projects... Thanks!


John VanSickle wrote:

> Tim Nikias wrote:
> >
> > Nontheless, I'm thinking how I can simplify the method of
> > counter-checking every new object with ALL objects
> > that were formerly generated. I do know of the subdivision
> > method, i.e. creating several blocks and only checking in
> > those and the nearest blocks, but are there any different
> > approaches, like sorting all positions somehow?
>
> Make a big two-dimensional array.  Initialize each value to a negative
> number, equal to the radius of the largest object you'll be placing.
>
> Map each object to a position in this array.  Fill in this position with
> the radius of the object, plus the amount of whatever
> minimum clearance you want between objects.  Fill in the surrounding
> spaces with values that decrease from this amount in a linear fashion,
> depending on the distance represented between the two; except that
> a higher value is never replaced with a lower one.
>
> For each object placed thereafter, check the position in the array
> that maps to the center of the object to be placed; if the value at
> that spot, plus the radius of the object, is greater than zero, the
> object will overlap another; pick another spot.
>
> The array doesn't need to be that precise.
>
> Can't figure out how to tell when the array is full, other than a
> brute-force check of the entire array.
>
> Regards,
> John




--
Tim Nikias
Homepage: http://www.digitaltwilight.de/no_lights/index.html
Email: Tim### [at] gmxde


Post a reply to this message

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