Wrapping Terrain

mrbrdo

25-01-2007 09:17:03

Hello

I am interested in how one would wrap terrain around using PLSM. What i mean is, when you get to the left end of the terrain, you would also start to see the right end of it, as if the terrain wrapped around to the other side.. So if you were moving left all the time, you would be moving center-left-right-center-left-right of the terrain all the time.
Any example would be greatly appreciated.

Thanks

mrbrdo

25-01-2007 17:03:14

anyone?

mrbrdo

25-01-2007 23:30:21

omg, bump :S

mrbrdo

26-01-2007 18:39:00

come on, surely someone knows?

Cutter

26-01-2007 22:51:08

Please don`t bump, your question isn`t that easy to answer.

If you really want to do this, I see 2 potential solutions:

1. dynamically create new tiles as the camera moves towards the current map borders or move the "old" tiles to the new position at the other side. Whatever you do, you also have to do the same with all objects on the tiles. This creates lots of problems with directions, especially when using a physics engine and object duplication.

2. create huge planes at the map borders and corresponding cameras at the opposite borders. Then the cameras images are the textures for the planes. As soon as the main camera "hits" a plane, you move it to the other side of the map. This approach does not need object and tile movement/duplication, but the scene has to be rendered multiple times (up to 3 times, if you are in a map corner) in a very high resolution (because the camera can come very close to those planes). There are also other problems, such as the height of the planes: the camera must not get higher than they are.

I never tried this out because I didn`t need the wrapping feature, but there were some posts in the past that requested it, so tell us what way you want to go and how it works!

mrbrdo

27-01-2007 15:17:09

Hey.

Thanks for the reply. I was already thinking of both these features as possible solutions, but someone on the main forum said this was already implemented in PLSM, so i wanted to check here.

I fancy the second method, because the graphics aren't really intense so it shouldn't put too big of a load on the GPU. I don't yet know about rendering to a texture, but i'll check an example in the wiki. Two things that i would like to ask here: could you elaborate on the resolution (how would i make it look the same as if the terrain was loaded 2 times, so it would not be obvious that it is rendered to a texture), and elaborate the part about the height of the planes.. I didn't quite get that.

Thanks

mrbrdo

27-01-2007 22:23:25

hmh, damn.. i tried rendering to a texture and it's not good enough.. the problem is because of the height of the terrain, basically the problem is with the border of the terrain.. the border (like left side) of a terrain is not a straight line because of the height of the terrain.. i don't see how this is fixable...
i was also thinking about a much better method - if i just made several viewports and split the screen up when you had to see the terrain multiple times.. but i then still have a problem when the terrain is higher than 0.
The "borderline" of the terrain is straight when have it on the center of the screen, but when you look at the border of the terrain FROM AN ANGLE (like if it is on the left side of the screen), it is not straight anymore.. and this is the problem

btw how to load a terrain several times and move it around?

any comments please :)

Cutter

29-01-2007 12:56:27

I´m not sure about what is your problem.
To be wrappable, you need a seamless terrrain texture. This should fix the problem with the terrain border that doesn`t fit to the other side.
If you tried it out, why not post some screenshots?

mrbrdo

29-01-2007 14:04:43

Cutter it's not only that, it's about how to do it.. I don't know what i should do, maybe i should load the terrain as a mesh and load more of them when needed (max 3 at any time)?
any other ideas greatly appreciated

Cutter

02-02-2007 15:36:11

No, if you want to take the duplication / movement approach, then I think you will have to modify PLSM2 and create new pages / destroy old ones / move others according to the camera movement.

I can`t tell you more because I just don`t know the details. Perhaps Tuan or Falagard can precise things a bit.

mrbrdo

02-02-2007 23:29:05

It's hard to get in to PLSM2 when there's hardly any documentation or support for it. I'm not going to go there, i even have some problems with Ogre itself..