P-152: Virtual World Concept Update 90: Chunked Levels of Detail Using Quad Trees Part 57
The level-order search algorithm seems to work fine, however, it did not fix the problem.
After much research, I believe I know what the problem is.
The quad tree part of the code may actually be working ok, the issue at the moment, I believe, is in generating the points in the correct order before feeding them to the quad tree.
I was using a simple loop of i and j values, scaling them, and projecting them to a sphere. However, this produces a range of values which traverse the entire terrain grid, so, if the grid has a resolution of 256*256, the i value will increment from 0 to 255 and then be reset to 0, j will then increment to 1, and the next row will be processed.
Since the quad tree is loaded in order from a list of points, this means that the quad tree is not being loaded with the correct points. I need to generate the points in the same order that the quad tree will be parsing them. So, I need to generate them in groups of 4. For example, for a resolution of 16 (4×4) I need to render the points in 4 groups of 4.
This is turning out to be very complex! I am having difficulty using a simple coordinate based system, and incrementing counters. I am also conscious of the fact that this system needs to work for all tiers, so for a resolution of 16 I need 4 groups of 4 nodes, but my solution needs to scale to a resolution of 64, 256, etc.
If this works, I should be able to get proof of concept, and I can then decide how to proceed from there.

