say,
position matrix 1,-2500,-15,-2500
G# = get ground height(1,X#-2500,Z#-2500)
I am don't works.
This test.
offset 0 - good
POSITION MATRIX 1, 0, 0, 0
y#=get ground height(1,x#,z#)+5
Rem (1) POSITION MATRIX test
create bitmap 1,32,32 : cls rgb(0,0,0) : ink rgb(0,145,0),0 : box 1,1,30,30
get image 1,0,0,32,32 : delete bitmap 1
make matrix 1,100,100,10,10
POSITION MATRIX 1, 0, 0, 0
prepare matrix texture 1,1,2,2
randomize matrix 1,30
set matrix height 1,2,5,100
update matrix 1
make object sphere 1,10
x#=50
z#=50
position camera 0,200,-100
point camera 0,100,0
sync rate 30 : sync on
rem Begin loop
do
set cursor 0,0
print "X:";x#
print "Y:";y#
print "Z:";z#
if upkey()=1 then z#=z#+1
if downkey()=1 then z#=z#-1
if leftkey()=1 then x#=x#-1
if rightkey()=1 then x#=x#+1
y#=get ground height(1,x#,z#)+5
position object 1,x#,y#,z#
sync
loop
offset -100 - broken
POSITION MATRIX 1, -100, 0, 0
y#=get ground height(1,x#-100,z#)+5
Rem (2) POSITION MATRIX test
create bitmap 1,32,32 : cls rgb(0,0,0) : ink rgb(0,145,0),0 : box 1,1,30,30
get image 1,0,0,32,32 : delete bitmap 1
make matrix 1,100,100,10,10
POSITION MATRIX 1, -100, 0, 0
prepare matrix texture 1,1,2,2
randomize matrix 1,30
set matrix height 1,2,5,100
update matrix 1
make object sphere 1,10
x#=50
z#=50
position camera 0,200,-100
point camera 0,100,0
sync rate 30 : sync on
rem Begin loop
do
set cursor 0,0
print "X:";x#
print "Y:";y#
print "Z:";z#
if upkey()=1 then z#=z#+1
if downkey()=1 then z#=z#-1
if leftkey()=1 then x#=x#-1
if rightkey()=1 then x#=x#+1
y#=get ground height(1,x#-100,z#)+5
position object 1,x#,y#,z#
sync
loop