@Kaedroho, sorry to be a bother but
I am having issues with BT, it is creating my terrains fine and all but it is apparently not giving me correct heights for some portions of the map, basically the majority of the map is correct but it seems at some curves on the hill that the height data and mesh data are not lining up as the mesh will be either above or below what the height reports back as a number which is causing invisible terrain points in which sometimes I will either go under the terrain or fly above it
My code that I am using is provided
dbLoadImage("Media/Map Split/35.bmp",5001);
dbLoadImage("Media/TM.bmp",5002);
dbLoadImage("Media/DM.bmp",5003);
BT_Init();
int objnum = 0;
unsigned int uiMain_Terrain = 0;
for(int X = -1;X < 2; X++)
{
for(int Y = -1;Y < 2;Y++)
{
objnum++;
unsigned int uiTerrain = 0;
if(X == 0 && Y == 0)
{
uiMain_Terrain = BT_MakeTerrain();
uiTerrain = uiMain_Terrain;
}
else
{
uiTerrain = BT_MakeTerrain();
}
BT_SetTerrainHeightmap(uiTerrain,5001);
BT_SetTerrainTexture(uiTerrain,5002);
BT_SetTerrainDetail(uiTerrain,5003);
//Set some other values
BT_SetTerrainScale(uiTerrain,128.0f);
BT_SetTerrainYScale(uiTerrain,32.0f);
BT_SetTerrainSplit(uiTerrain,8);
BT_SetTerrainDetailTile(uiTerrain,8.0f);
BT_SetTerrainQuadRotation(uiTerrain,true);
BT_SetTerrainSmoothing(uiTerrain,8);
//LOD
BT_SetTerrainLOD(uiTerrain,1);
//BT_SetTerrainLODDistance(uiTerrain,1,2048*1);
//BT_SetTerrainLODDistance(uiTerrain,2,2048*2);
/*
BT_SetTerrainLODDistance(uiTerrain,3,2048*3);
BT_SetTerrainLODDistance(uiTerrain,4,2048*4);
BT_SetTerrainLODDistance(uiTerrain,5,2048*5);
BT_SetTerrainLODDistance(uiTerrain,6,2048*6);
BT_SetTerrainLODDistance(uiTerrain,7,2048*7);
*/
//Build Terrain
BT_BuildTerrain(uiTerrain,52308+objnum,true);
dbPositionObject(52308+objnum,16384*X,0,16384*Y);
}
}
//BT_SetCurrentCamera(0);
BT_EnableAutoRender(1);
while(LoopGDK())
{
oe::GFX::Basic3D::Position_Object(iTest_Object_1,oe::GFX::Basic3D::Get_Object_Position_X(iTest_Object_1),BT_GetGroundHeight(uiMain_Terrain,oe::GFX::Basic3D::Get_Object_Position_X(iTest_Object_1),oe::GFX::Basic3D::Get_Object_Position_Z(iTest_Object_1)),oe::GFX::Basic3D::Get_Object_Position_Z(iTest_Object_1));
}
NOTE: I am not gathering height data for the other terrains as I am only using the uiMain_Terrain one (which is positioned at 0,0) but they are all the same
EDIT: I have supplied the heightmap I am using that I encounter this problem with, even when I randomly place objects on the map just using position coords I still see objects floating on areas that I get the same issue with..
Making dreams possible, one line at a time...