P-152: Virtual World Concept Update 87: Chunked Levels of Detail Using Quad Trees Part 54
I have been researching the current issues that I have been having with the Spherical Terrain in some detail.
I believe that, basically, what is happening is that the distances between the player and each node are wrong.
Due to the way that the different levels of detail of the quad tree are created, some of the nodes from different tiers overlap. However, for my current algorithm, I am splitting each node within range of the player into its child nodes, and then further subdividing each of those child nodes if their (the child nodes) distance is also within the players view distance.
Theoretically, this should work, however, since some nodes overlap other nodes of different detail levels, the distance values are not correct, sometimes, for example, a node’s distance will exceed the players view distance, and will not be subdivided, but it’s childnodes will actually be within the players view distance, and so, should be subdivided. This, I believe, is the reason for the missing nodes in the spherical terrain rendering (visible in the below images).
To fix this, I believe I can use 3D to 2D projection, or 3D Projection. This basically takes a 3 dimensional point and projects it onto a 2 dimensional plane, similar to the “window to viewport transformation” that is done in the rendering pipeline.
If I make sure to project each point (parent nodes, child nodes, etc) into the same 2D plane, then I should essentially be able to convert a 3D problem into a 2D problem, and then get the 2D distance from the player to the point or node in question. It then shouldn’t matter if there is an offset between the points in 3D space, since they will all be “collapsed” essentially into the same 2D plane, and only their positions in the other two dimensions will matter.
I have found what seems to be a fairly simple implementation here: 3D Perspective Projection, but I have to do a lot more research to properly understand what is going on here.
If this works, I should, finally, achieve proof of concept for the Spherical Terrain, and I can then add the next steps to it (Massive terrain, texturing, etc) before I move on with the project.