Original Post
Hey, Ok, so I've created a quadtree and have split up my terrain into chunks which are each then assigned to a unique leaf node in the quadtree. Each chunk is simply a unique set of indices that operate on the same full set of vertices. Now, I want to make the terrain "looping," so that if the player moves off the edge of the terrain, he will pop back to the other side. I can change his position accordingly, this is no problem. However, as the player approaches the edge of the terrain, they see the 'edge of the world' right up until they are popped back to the other side -- not a very convincing illusion. So, I need some way to detect that the viewing frustum is viewing off past the edge of the terrain, and render the appropriate amount of nodes from the other side of the terrain to fill it up. Maybe these pictures will clarify a little:
In the image to the left, you can see that as the player approaches the left side of the terrain, most of his viewing frustum is seeing nothing -- the player sees the edge of the world. In the image to the right, nodes 3 and 4 are drawn again infront of the player to give the illusion of looping terrain. Once the player hits the edge of the "actual" nodes, they will seamlessly pop back to the other side. So, my problem: I'm unsure of a clean algorithm to do this, or if this is even the best way... Has anyone ever attempted something like this? Is there a good way to organize my quadtree-scene graph to set something like this up?
In the image to the left, you can see that as the player approaches the left side of the terrain, most of his viewing frustum is seeing nothing -- the player sees the edge of the world. In the image to the right, nodes 3 and 4 are drawn again infront of the player to give the illusion of looping terrain. Once the player hits the edge of the "actual" nodes, they will seamlessly pop back to the other side. So, my problem: I'm unsure of a clean algorithm to do this, or if this is even the best way... Has anyone ever attempted something like this? Is there a good way to organize my quadtree-scene graph to set something like this up?