I'm trying to create more than one terrain with Blitz terrain(free), but getting error: "BT Error:Allready building. Function BT BuildTerrain. Any ideas?"
sync on : sync rate 0 : sync
center text screen width()/2,screen height()/2,"Loading..." : sync : cls
global g_HeightmapImgID : global g_TextureImgID : global g_DetailmapImgID
g_TextureImgID=20 : g_DetailmapImgID=30
load image "..\Media\t1.bmp",1
load image "..\Media\t2.bmp",2
load image "..\Media\texture.jpg",g_TextureImgID
load image "..\Media\detail.tga",g_DetailmapImgID
for a =1 to 2
g_TerrainID=0
g_TerrainID=BT MakeTerrain()
if g_TerrainID>0
BT SetTerrainHeightmap g_TerrainID,a
BT SetTerrainTexture g_TerrainID,g_TextureImgID
BT SetTerrainDetail g_TerrainID,g_DetailmapImgID
BT SetTerrainScale g_TerrainID,12.0
BT SetTerrainYScale g_TerrainID,2.0
BT SetTerrainSplit g_TerrainID,8
BT SetTerrainDetailTile g_TerrainID,3.0
BT BuildTerrain g_TerrainID,a,1
if bt terrainexist(g_TerrainID)=1
text 10,10,"terrain ok"
sync
endif
endif
next
//Setup camera
set camera range 10,10000
hide mouse
//Enable auto render
BT EnableAutoRender 1
//Main loop
StartTime=timer()
do
//Camera movement
Elapsedtime#=(timer()-StartTime)/3000.0+Elapsedtime#*0.7
StartTime=timer()
cx#=camera angle x()+mousemovey()/4.0
if cx#>90.0 then cx#=90.0
if cx#<-90.0 then cx#=-90.0
rotate camera cx#,camera angle y()+mousemovex()/4.0,0.0
if upkey() then move camera 1000.0*Elapsedtime#
if downkey() then move camera -1000.0*Elapsedtime#
gheight#=BT GetGroundHeight(g_TerrainID,camera position x(),camera position z())
if camera position y()-40<gheight# then position camera camera position x(),gheight#+40,camera position z()
text 10,10,str$(screen fps())
position mouse screen width()/2,screen height()/2
sync
loop
end
Sky. It's at my fingertips...
Webpage at http://skywriter.comuf.com