Mesh Terrain to 8bit Height Map

Blitz3D Forums/Blitz3D Programming/Mesh Terrain to 8bit Height Map

stupid me. i missed the (not a blitz terrain) in your post.

i'd go with what AAB said, with the linepicks. in order to convert it to a heightmap, you'd have to have some kind of min and max height.. ah, just use MeshHeight(). something like this pseudocode:

;load terrain object
;set its pickmode to poly
if meshwidth(t)>meshheight(t) then w#=meshwidth(t) else w#=meshheight(t)
steps=256 ;how detailed the map is
maxheight#=meshheight(t)
;this assumes that the bottom-left corner is at 0,0,0, so all points on the terrain are at least 0 height
for x#=0 to w# step (w#/steps)
    for z#=0 to w# step (w#/steps)
        linepick x#,maxheight#,z#,0,-maxheight#,0
        c=(pickedy()/maxheight#)*255
        ;write color to heightmap image at x,steps-z
    next
next


something like that.