Me again. I just downloaded the Advanced Terrain add-on for DBP, and i've run into a problem. When my terrain renders, it's upside down. What i mean is that the texture is on the bottom of the terrain, not the top. The code i am using calls a sub-routine to load the terrain (see code example), and calls update terrain every loop.
load image "media\tracks\desert\desert.bmp", 2
load image "media\tracks\desert\detail.tga", 3
make object terrain 2
set terrain heightmap 2, "media\tracks\desert\desertheightmap.bmp"
set terrain scale 2, 5, 1, 5
set terrain split 2, 16
set terrain tiling 2, 4
set terrain texture 2, 2, 3
build terrain 2
I've attached the heightmap too see if anyone else gets the same problem. OK, something strange just happened... when i loaded my track, it was actually right way up, until i moved my mouse then it went black, then upside down again, so it could be something to do with the movement... better put that code here too. This is being called from inside the game loop.
` simple mouse and keyboard movement
` move around with arrow keys
control camera using arrowkeys 0, 1, 1
` store old camera angle
OldCamAngleY# = CameraAngleY#
OldCamAngleX# = CameraAngleX#
` store new camera angle
CameraAngleY# = wrapvalue ( CameraAngleY# + mousemovex ( ) * 0.4 )
CameraAngleX# = wrapvalue ( CameraAngleX# + mousemovey ( ) * 0.4 )
` rotate camera
yrotate camera curveangle ( CameraAngleY#, OldCamAngleY#, 24 )
xrotate camera curveangle ( CameraAngleX#, OldCamAngleX#, 24 )
I'm not really worried about my matrix collision thread, cos this is easier to do, the code is much neater and easier to understand, but i still need help, so if anyone can help, it would be greatly appreciated.
One more thing, when i downloaded Adavnced terrain and installed it, i noticed that there were no keywords, so i made my own advancedterrain.ini file, so if anyone is interested, i'll post it here, or somewhere else.