A new data structure... CLABT (move over ABT!)

Started by
22 comments, last by Lithic 20 years, 7 months ago
Karl - I look forward to hearing how things work out with that. The neighbour feature could be very tedious and annoying to implement in an ABT, because there could be any number of neighbours.

It''s good having a thread like this, where ideas for new trees and alterations of trees can be criticised constructively and postively.
Advertisement
Ok well here''s what I was thinking. I kinda hit a deadend after pondering how to implement it but this was my train of thought...


1. All nodes are a rectangular prism. (If I got this wrong then the rest of this post may as well be igored *gulp*)
2. Therefore, assuming that you can kill off the annoying effect of distant objects getting smaller, if you view the entire "world" of boxes from one side you''ll see where things overlap.
3. Being as certian portions overlap all the way down through the boxes, you create a list of rectangles for each dimension (x, y and z) that have boxes contained within them, down to the smallest one with even only 1 box overlapping.
4. Boxes cannot overlap
5. Starting with one side and ending with another (such as +X to -X, +Y to -Y and +Z to -Z) you arrange a list inside each rectangle, in depth order, of the boxes. Note that some rectangles will be overlapping others.
6. This is where I left off...

I hope you can see where I was going with that. Basically you could cast a ray down a "rectangle" and find what it intersects. There are a couple big problems with it that I now see but I hope I got some creative juices flowing Can''t say I didnt try hehe
Karl, your idea is not that far fetched. The problem with loose structures, such as an ABT, is that there is no direct hierarchical relationship between spatially close nodes. Nodes can practically be in arbitrary positions, two hierarchically close branches don''t have to be spatially near. The opposite is also true: two spatially close nodes don''t have to be hierarchically related in any way. In fact, they could be at opposite sides of the tree !

So, you definitely need a separate structure representing purely spatial relationships, independent of the hierarchy itself. The concept Karl mentioned is basically a kind of PVS for ABT nodes, let''s called it a ''potential neighbour set''. Note the term ''potential'': since ABTs do not have guaranteed neighbours, such a structure could only hold an approximation. But that''s perhaps all you need. For every side of a node (+x, +y, +z, -x, -y, -z) keep a linked list of pointers to other nodes that are potentially close to the respective side of the node. When moving a dynamic object through the tree (growing nodes as needed), this structure would help tremendeously in determining new candidate insertion points for the object. Assuming the tree becomes too denormalized, then instead of rebuilding the whole denormalized branch, you could simply ''snap it back''. The dynamic object would then ''float'', ie. it would be unassigned. Using the potential neighbour sets of the old parent node, you would then perform a local restricted search through the set, trying to get the best fit node for reinsertion of the dynamic object.

Such an ABT extension would certainly work. But the main problems I see with that approach are memory consumption (the potential neighbour lists can quickly get overwhelming in terms of size) and search speed (in very deep branches with tons of spatially near nodes). And most important of all, keeping the structure up-to-date as the tree moves/deforms, at interactive rates, is going to be a major challenge.
"Quotes Yann L's Post"

^^ That's what I mean to say Now that I reread my post a few days after I think I stated it pretty strangely and I contradicted myself, but I'm glad someone was able to make sense of it!

The major problem as I see it is that the sets are only "potential" and cannot really be relied too heavily upon.

-------------------------- New Idea ---------------------------

Ok, new idea time. The purpose of this entire post was to be able to keep track of dynamic objects moving throughout the scene, right? So here's my thought.

Each object has it's own node (with possible subnodes if it is complex). As this object moves, it is migrated around the tree's other nodes... And now for some ascii art.

// Karl's Wonderful ASCII art!|---------A|| |-B|     || |--| |--C||   D  |   ||------|---|  


Each "node" represented by a box has a label in the top righthand corner. The largest one, A, contains B, C and the very small (object box) D. D represents our dynamic object. As D moves around, it can become incorporated into B or C when it moves inside, and therefore will migrate further down the hierarchy. When it leaves a space, it can migrate back up.

---------------------- Another Thought ---------------------
This was just a random thought I had when thinking about the problem of constructing neighbours. Why would it be so hard to cast a ray through the hierarchy? I mean, isn't that what you do when you check for culling procedures? Just check for which nodes are visible with no (or a very small) camera FOV in the desired location/direction.


Ok so those are my big thoughts for today. It's time for more homework...

*edit* misworded a sentence

[edited by - Karl G on September 9, 2003 9:55:10 PM]

This topic is closed to new replies.

Advertisement