Norbert Kern wrote:
>
> What is a spatial data structure?
A tree stucture like an octree/quadtree or BSP tree that makes it very
efficient to access an element at a certain location.
Note in your case (and esp. for implementation in SDL) it might be the
best approach to use a regular grid to store your locations in (or
alternatively using spatial hashing if a grid would be too large). This
technique is widely used in molecular dynamics simulation. What would
be necessary for this to work is a limited density or the plants. If a
large number of plants can occur very close to each other that would be
quite difficult to handle in SDL with a grid.
The idea is that with a grid cell size >= the maximum 'influence
distance' of the plants only plants in neighboring grid cells can
influence each other. With a limited plant density that would only take
constant time.
Christoph
--
POV-Ray tutorials, include files, Landscape of the week:
http://www.imagico.de/ (Last updated 01 Jun. 2006)
MegaPOV with mechanics simulation: http://megapov.inetart.net/
Post a reply to this message
|