My next step is to deal with quadtrees.
Best described in wiki, quadtree is:
..is a tree data structure in which each internal node has up to four children.
Imagine a plane, that consist of a single quad only. If we move closer to it, and we want to add more detail, we need to split this quad (so it become more detailed). Because the name of quad speaks for itself, the best way to split is to divide it on 4 small quads. If we had one quad before (called root or branch), these 4 new quads will become children (or leafs) of the previous quad.
So, the quadtree is a structure, that holds "branches" and their leafs (if any). Each branch may have 4 children or 0 children. The node that do not have any children called "leaf", all others are branches. Quite simple, isn't it? You may look also here for more detailed explanation if you haven't caught something.
So my first task is to "make" a test quad and then try to split it. The main problem that anyone can encounter is to calculate all points of child nodes correctly.
No comments:
Post a Comment