I am having a difficult time grasping how to iterate an octree or quad. And it may be because I am not experienced with different mythologies of iterating. But let’s suppose that I produced a quad tree that holds float x,y,z; dword color. Now, Let’s also say that this node can only produce 4 children at a time (and those children can both produced 4 children, etc, etc) up until: 7 levels are reached (so that child can’t create anymore children, but its brothers/sisters can), all 4 children created are the same dword color (again, if that happens, its brothers/sisters can still produce), or total nodes created are equal to 87380. When the above happens, it is placed into a container. And the process continues.
Now this container that holds the nodes is (for example) 7 levels deep, all children of children of children all different x,y,zs, and colors. The problem I am having is how I iterate this container, how can I go through all the children, sisters? Since the root leads to 4 children, and those 4 children have 4 children, etc, etc, etc: 4^1+4^2....+4^7. How can I find the node I want, without writing complex if statements, and iterating over the whole node (starting from root)? Does the container (the one that produces the node) need additional code that allows this process to be simple?
Sorry if the question is to general.