hey, i found sumtin on the internet, and it does the heightmap function, but mine aint enhanced, if u wanna see it here you go....
`Heightmap code
set display mode 1024,768,32
sync on
sync rate 1000
backdrop on
color backdrop rgb(0,200,255)
set camera range 1,5000
fog on
fog distance 7000
fog color rgb(0,200,255)
hide mouse
set ambient light 100
`arrays
dim hmap(1)
getheightbmp("hmap.bmp")
load image "texture.bmp",100
make matrix 1,5000,5000,70,70
prepare matrix texture 1,100,1,1
for x=1 to 70
for z=1 to 70
set matrix height 1,x,z,hmap(x,z)*3
next z
next x
update matrix 1
camspeed#=10
do
set cursor 10,10
print "FPS: ",screen FPS()
rem Crude way to fix mouse pointer (hide this and run again)
position mouse 320,240
camf#=0
camx#=wrapvalue(camx#-mousemovey()*0.4)
camy#=wrapvalue(camy#+mousemovex()*0.4)
acamx#=curveangle(camx#,acamx#,2.5)
acamy#=curveangle(camy#,acamy#,2.5)
rotate camera acamx#,acamy#,0
if mouseclick()=1 then camf#=camf#+camspeed#
if mouseclick()=2 then camf#=camf#-camspeed#
if leftkey()=1 then camy#=wrapvalue(camy#-3.0)
if rightkey()=1 then camy#=wrapvalue(camy#+3.0)
if upkey()=1 then camx#=wrapvalue(camx#+3.0)
if downkey()=1 then camx#=wrapvalue(camx#-3.0)
if shiftkey()=1 then camf#=camf#+camspeed#
if controlkey()=1 then camf#=camf#-camspeed#
if camf#<>0 then move camera camf#
x#=camera position x()
y#=camera position y()
z#=camera position z()
yg#=get ground height(1,x#,z#)+10
if y#<yg#
position camera x#,yg#,z#
else
position camera x#,y#,z#
endif
rem Update screen
sync
loop
function getheightbmp(file$)
`this function only gets information from a 24-bit bitmap
`so make sure you save it as one
open to read 1,file$
`--------------------
`decode the header
`The info contained here is not usefull.
read byte 1,notusefull
read byte 1,notusefull
read long 1,notusefull
read long 1,notusefull
read long 1,notusefull
read long 1,notusefull
`--------------------
`Get Bitmap Width
read long 1,BmpWidth
`Get Bitmap Height
read long 1,BmpHeight
`--------------------
read word 1,notusefull
`--------------------
`Get BitDepth
read word 1,BitDepth
`--------------------
`The info contained here is not usefull.
read long 1,notusefull
read long 1,notusefull
read long 1,notusefull
read long 1,notusefull
read long 1,notusefull
read long 1,notusefull
`--------------------
`error check only if bitdepth=24
if BitDepth=24
ypos=BmpHeight
` Calculate If bmp required Padding
bmpwidth#=bmpwidth
evenwidth1#=(BmpWidth#*3)/4
evenwidth2=(BmpWidth*3)/4
padlen=0
if evenwidth1#<>evenwidth2
evenwidth1#=evenwidth1#-evenwidth2
padlen=4-(evenwidth1#*4)
endif
`-------------------------------------------
`create the hmap array
dim hmap(bmpwidth,bmpheight)
`-------------------------------------------
`Get color info
For Ylp=1 to BmpHeight
for Xlp=1 to Bmpwidth
`Read color values
read byte 1,blue
read byte 1,Green
read byte 1,red
`enter color info into height array
hmap(xlp,ypos)=(blue+green+red)/3
next Xlp
dec Ypos
`Padding
if padlen<>0
for padlp=1 to padlen
read byte 1,padbyte
next padlp
endif
next Ylp
endif
close file 1
endfunction
=======================
i added better controls and stuff
"Well, if he dies it'll teach him not to do it again." - Me