I'll "Illegal terrain size" YOU!
Blitz3D Forums/Blitz3D Beginners Area/I'll "Illegal terrain size" YOU!
| ||
| 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? |
| ||
| If you are saying that the heightmap image is 64x64 then that should work. LoadTerrain will build a 64x64 terrain. |
| ||
| Let's see the code! |
| ||
| 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. |
| ||
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
|
| ||
| 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. |
| ||
| thanks |
| ||
| GNS - you save lives. |
| ||
| Glad I could help. :) |