I'll "Illegal terrain size" YOU!

Blitz3D Forums/Blitz3D Beginners Area/I'll "Illegal terrain size" YOU!

wizzlefish(Posted 2004) [#1]
Blitz3D documentation CLEARLY states that you can load in any size terrain. I used a default size (64x64) and it says "Illegal Terrain Size."

Eh?


Floyd(Posted 2004) [#2]
If you are saying that the heightmap image is 64x64 then that should work.
LoadTerrain will build a 64x64 terrain.


sswift(Posted 2004) [#3]
Let's see the code!


TomToad(Posted 2004) [#4]
You sure it isn't 65x65? Had that problem once when I started with a larger canvas, then decided I wanted it smaller so I cropped from 0,0 to 64,64 which created a 65x65 heightmap.


wizzlefish(Posted 2004) [#5]
I opened "Total Terrain" and clicked "New -> 64x64" and made it on that.....then saved the heightmap as "heightmap.bmp" and loaded it into Blitz with this:

;TERRAIN
map = LoadTerrain("level\heightmap.bmp")
color = LoadTexture("level\colormap.bmp")
terrain = CreateTerrain(map)
EntityTexture map, color



GNS(Posted 2004) [#6]
It's failing because CreateTerrain() is used to create a new terrain from scratch (i.e. not from an image). If you look at the CreateTerrain() docs you'll see it takes a grid size as a parameter, not an image file.

In the above example, 'map' points to a terrain that uses the heightmap you created.

To 'fix' the above example, remove 'terrain = CreateTerrain(map)' and you should be good to go.


wizzlefish(Posted 2004) [#7]
thanks


wizzlefish(Posted 2004) [#8]
GNS - you save lives.


GNS(Posted 2004) [#9]
Glad I could help. :)