Hello. I am wondering how i would go about wrapping terrain, like in the game Moonbase Commander. A picture says a thousand words, so:
If you look at the map in the upper-right corner you see you actually see on screen the bottom part of the terrain + the upper part (kinda wraps around).. Same thing happens if you go to the left, you just come to the right and then trough the middle back to the left, right again, middle...
I hope you guys understand what i mean. Tell me if someone has an idea on how to do this.
you could draw the land around the corner for a second time, when the camera comes on the bottom edge of the map its goes to the upper edge of the world.
strong99: there's a problem with that method though, you'd also have to draw all units\models (in case of this specific game) again.. i think there could be a better solution so keep em coming thanks for the replies so far
i thought there was a more elegant way of doing it..
what i'll try:
load 9 instances of the terrain and then mirror the action on the main (center) terrain to all other 8 terrains around the center terrain.. then, whenever camera goes out of the center terrain, i move the camera back to the center terrain in such a way that the image would seem the same.
like (terrains 1-9, 5 is the center one).
______
|1|2|3|
|4|5|6|
|7|8|9|
--------
say camera is in the bottom-right corner of 1, i would move the camera to the bottom-right corner of 5. or, if the camera is showing bottom of 1 and top of 4, i would move the camera to show bottom of 5 and top of 8. This way i would always keep at least a very small part of 5 on screen so wherever you'd move you would always seem to "wrap" around. btw i was thinking i could also render terrain 5 on a texture and then just put textured quads 1-9.. it should work the same way, but should be a bit more efficient.
i don't think this solution is very efficient though.. is there not a more advanced way of doing this, which would not require to duplicate all of the models\terrain so many times?