Place meshes on terrain

Blitz3D Forums/Blitz3D Programming/Place meshes on terrain

I'd recommend having the heightmap / object data on the same image ... the red rgb is used for terrain heightmap so you could use the blue rgb value for the objects.

Say you had 10 objects.

Object1 , blue = 0
Object2 , blue = 25
etc....

Then you would colour that pixel based on it's height ( red ) and object ( blue )

So if the pixel was Color 255, 50,0 it would be object type 3 at the highest possible landheight.

To retreive the object data it's a simple case of checking the blue value in each pixel ...

e.g. Like this ...

Objectindex = Floor( ColorBlue() / 25 )

Select ObjectIndex
case 0 DoTree()
case 1 DoBuilding()
end select

etc....