@kaedroho: I've just noticed that you've posted an update to the free version in an attempt to rectify the delete terrain crashes. I'm currently using the full version which does crash on the 3rd execution of the BT BuildTerrain command. With the following code you need to press the 'l' key to create a terrain and the ';' to delete them - (sorry, I've just quickly rehashed the smoothing example code to test it).
//BLITZWERKS TERRAIN 2.02 EXAMPLE - SMOOTHING
//CREATED BY KARL HOBLEY (KAEDROHO) http://www.blitzwerks.co.uk
//CODE BELOW MAY BE USED IN COMMERCIAL AND NON COMMERCIAL PROJECTS
//CREATED AND TESTED WITH DBPRO 7.5
//This demo shows how to add smoothing. This will make your terrains look alot more realistic and reduce sharp edges!
//Smoothing has been added in the heightmap loading system (located inside BT BuildTerrain).
//It gets the average of the 8 points around a point then averages that with the point in the middle.
//CONTROLS
//ARROWKEYS AND MOUSE - MOVE
// F1 - WIREFRAME ON. F2 - WIREFRAME OFF
//Build
global g_TerrainObjectID
g_TerrainObjectID=1
//Setup
sync on : sync rate 0 : sync
center text screen width()/2,screen height()/2,"Loading..." : sync : cls
//Load media
global g_HeightmapImgID : global g_TextureImgID : global g_DetailmapImgID
g_HeightmapImgID=1 : g_TextureImgID=2 : g_DetailmapImgID=3
load image "..\Media\heightmap.bmp",g_HeightmapImgID,1
load image "..\Media\texture.jpg",g_TextureImgID,1
load image "..\Media\detail.tga",g_DetailmapImgID,1
t = 0
DO
rem cls
if inkey$() = "l"
if bt terrainexist(TerrainID) = 0
inc t
TerrainID = BT MAKETERRAIN()
BT SetTerrainHeightmap TerrainID,g_HeightmapImgID
BT SetTerrainTexture TerrainID,g_TextureImgID
BT SetTerrainDetail TerrainID,g_DetailmapImgID
//Set some other values
BT SetTerrainScale TerrainID,12.0
BT SetTerrainYScale TerrainID,2.0
BT SetTerrainSplit TerrainID,8
BT SetTerrainDetailTile TerrainID,3.0
BT BuildTerrain TerrainID,g_TerrainObjectID,1
BT EnableAutoRender 1
endif
endif
if inkey$() = ";"
if bt terrainexist(TerrainID) = 1
BT DELETETERRAIN TerrainID
delete object g_TerrainObjectID
endif
endif
text 10,100,str$(TerrainID)
text 10,120,str$(t)
//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()
//Wireframe
if keystate(59) then set object wireframe g_TerrainObjectID,1
if keystate(60) then set object wireframe g_TerrainObjectID,0
//FPS
text 10,10,str$(screen fps())
text 100,100, str$(x)
//Position mouse
position mouse screen width()/2,screen height()/2
sync
LOOP
On the full version it crashes on two separate pcs (both only using XP)on the third attempt to build the terrain; it cites blitzterrain.dll as the faulting ModName at offset 00009d11.
With the new free version - it still crashes on the 3rd attempt to build the terrain but it cites ModName mscvr100.dll this time at Offset 00001ed7.
Unfortunately, I've been unable to implement this fine-looking plugin up to now because of this bug. If you need any further info/tests etc. then just let me know, I'm happy to help in any way I can.