Hi
I'm trying to figure out how to make a terrain of a matrix.
So far i have this code:
sync on
Sync rate 60
load image "forfanden.bmp",1
make object sphere 1,2
position object 1,100,0,100
make matrix 1,100,100,10,10
prepare matrix texture 1,1,10,10
for x=1 to 100
fill matrix 1,rnd(50),x
next x
update matrix 1
do
py#=object angle y(1)
matrix=matrix tile count(1)
set cursor 0,50
print matrix
x#=object position x(1)
y#=object position y(1)
z#=object position z(1)
for x= 1 to 10
for z= 1 to 10
ppy#=get matrix height(1,x,z)
next x
next z
if object position y(1)<ppy#
move object up 1,1
endif
if object position y(1)>ppy#
move object down 1,1
endif
set cursor 0,0
print scancode()
set cursor 0,10
print "Screen FPS : ";screen fps()
set cursor 0,20
print x#
set cursor 0,30
print y#
set cursor 0,40
print z#
if keystate(200)=1
move object 1,1
endif
if keystate(208)=1
move object 1,-1
endif
if keystate(203)=1
yrotate object 1,py#-1
endif
if keystate(205)=1
yrotate object 1,py#+1
endif
position camera object position x(1), object position y(1), object position z(1)
rotate camera 0, py#, 0
move camera -5
position camera camera position x(), camera position y()+2.5, camera position z()
point camera object position x(1), object position y(1), object position z(1)
sync
loop
But how do I make a bumpy terrain of the Matrix? All I get with this code is a totally flat matrix...
I hope someone will help
KLU 007