there is gap with multi terrain . anyone help?


06-08-2010 13:48:33

hi there, i am using MET version atm. i got one thing which dont understand. when i create 2 or 3 terrains in my world, always there is a gap between them.

for example, my heightMap size is 513 * 513 . i define this heightmap match the worldsize (vector3(0,0,0) to vector(1024,0 1024)). and next terrain use same size of heightmap, the worldsize is from vector(1024,0,0) to vector (2048,0,1024). those two terrains should be seamless. but in my world there is a gap between them . the gap looks like is 2 ogre unit.

someone could help me with this. many thanks in advance.


10-08-2010 20:17:07

Yes, this is expected behaviour. The different terrains don't know anything about each other, and therefore they can't match their borders. This is a flaw of the geomipmapping approach. To circumvent that, you'd have to tell the terrains about each other, but this is not implemented in ETM.


11-08-2010 13:13:46

thanks so much for your reply.

here is my code to create first terrain:

float[] hm = new float[513* 513];
for (int i = 0; i < 513* 513; i++)
hm = 0.5f;
terrainInfo = new MET.TerrainInfo((uint)513, (uint)513, hm);
//set terrain area in the scene
float maxX = (513-1 ) * 2;
float maxZ = (513-1 ) * 2;
terrainInfo.Extents = new Mogre.AxisAlignedBox(0, 0, 0, 1024, 12000, 1024);
terrainManager.CreateTerrain(terrainInfo, 129, 1, true);

about above codes, what i think this terrain should be show in the scene at vector3(0,6000,0) to vector3(1024,6000,1024).
but in fact in the scene this terrain only from vector3(0,6000,0) to vector3(1022,6000,1022).

what my question is what correct AxisAlignedBox is for one 513*513 heightmap which start from vector3(0,0,0)?

vector3(0,6000,0) to vector3(1022,6000,1022) OR vector3(0,6000,0) to vector3(1024,6000,1024)?

if (vector3(0,6000,0) to vector3(1022,6000,1022) ) is right one , i will adjust the terrain Coordinate in my aplication.

sorry for this newbie question. many thanks in advance.