I know what you mean by the DAMN TRIANGLES!
Only tested in DBPro
sync on : randomize timer() : autocam off : hide mouse
rem *** bitmap variables ***
rem below will create 4*4=16 random tile textures at 64*64 pixels
rem this is same as loading an image of 256*256 pixels cut up into 16 tiles
r=64 : rem texture resolution (32,64,128,256)
w=4 : rem tile width
h=4 : rem tile height
rem *** matrix variables ***
mw=2000 : rem units wide
mh=2000 : rem units high
mx=64 : rem number of tiles wide
mz=64 : rem number of tiles high
rem *** player variables ***
cx#=100 : rem start x position
cz#=100 : rem start z position
cya#=0 : rem start y angle
cxa#=0 : rem start x angle
ch=20 : rem height above ground of player's eyes
rem *** collision variables ***
s#=0.5 : rem step size
r#=10 : rem player radius
frc#=75 : rem force (bigger number means bigger slopes can be climbed)
rem *** player camera variables ***
mang#=80 : rem maximum angle you can look up or down
midx#=3 : rem smoothness of mouse camera (higher=smoother)
gosub setupbitmap
gosub setupmatrix
gosub setupwater
h#=get ground height(1,cx#,cz#)
position camera cx#,h#+ch,cz#
ink rgb(255,255,255),rgb(0,0,0)
water#=0
do
x# = camera position x()
y# = camera position y()
z# = camera position z()
if upkey()
x#=newxvalue(x#,cya#,s#)
z#=newzvalue(z#,cya#,s#)
endif
if downkey()
x#=newxvalue(x#,cya#,-s#)
z#=newzvalue(z#,cya#,-s#)
endif
if rightkey()
x#=newxvalue(x#,wrapvalue(cya#+90.0),s#)
z#=newzvalue(z#,wrapvalue(cya#+90.0),s#)
endif
if leftkey()
x#=newxvalue(x#,wrapvalue(cya#-90.0),s#)
z#=newzvalue(z#,wrapvalue(cya#-90.0),s#)
endif
rem *** sliding collision (start) ***
fx#=0 : fz#=0
for r=0 to 35
ex#=newxvalue(x#,r*10.0,r#)
ez#=newzvalue(z#,r*10.0,r#)
eh#=get ground height(1,ex#,ez#)
if eh#<0 then eh#=(-eh#*20)
force#=eh#/frc#
fx#=fx#+((ex#-x#)*force#)
fz#=fz#+((ez#-z#)*force#)
next r
x#=x#-(fx#/35.0)
z#=z#-(fz#/35.0)
rem *** sliding collision (end) ***
h#=get ground height(1,x#,z#)
position camera x#,h#+ch,z#
cya#=wrapvalue(cya#+(mousemovex()/midx#))
cxa#=cxa#+(mousemovey()/midx#)
if cxa#<-mang# then cxa#=-mang#
if cxa#>mang# then cxa#=mang#
rotate camera wrapvalue(cxa#),cya#,0
water#=wrapvalue(water#+0.5)
position object 1,object position x(1),-10+(2*sin(water#)),object position z(1)
sync
loop
end
rem ********************
setupbitmap:
create bitmap 1,w*r,h*r
b=0
for f=1 to h
for g=1 to w
ink rgb(b,b,b),rgb(0,0,0) : box (g-1)*r,(f-1)*r,g*r,f*r : b=rnd(255)
next g
next f
for f=1 to (w*h*10)
a1=rnd(w*r) : b1=rnd(h*r) : c1=rnd(20)+2 : d1=rnd(20)+2
ink rgb(rnd(255),rnd(255),rnd(255)),rgb(0,0,0)
box a1,b1,a1+c1,b1+d1
next f
get image 1,0,0,w*r,h*r
delete bitmap 1
return
rem ********************
setupmatrix:
make matrix 1,mw,mh,mx,mz
set matrix 1,0,0,1,1,1,1,1
prepare matrix texture 1,1,w,h
fill matrix 1,0,1
for f=1 to (mx-2)
for g=1 to (mz-2)
set matrix tile 1,f,g,rnd((w*h)-1)+1
next g
next f
for f=0 to mx
set matrix height 1,f,0,150+rnd(20)
set matrix height 1,f,mz,150+rnd(20)
next f
for f=0 to mz
set matrix height 1,0,f,150+rnd(20)
set matrix height 1,mx,f,150+rnd(20)
next f
for f=1 to (mx*mz/5)
set matrix height 1,(5+rnd(mx-10)),(5+rnd(mz-10)),rnd(100)
next f
for f=0 to mz-10
set matrix height 1,1,f+5,f*2
set matrix height 1,2,f+5,f*2
next f
for f=1 to 5
for g=1 to 5
set matrix height 1,f+7,g+2,-50
set matrix height 1,8,g+7,-50
next g
next f
update matrix 1
return
rem ********************
setupwater:
make object plain 1,mw,mh
rotate object 1,90,0,0
color object 1,rgb(0,0,255)
position object 1,mw/2,0,mh/2
ghost object on 1
return
I love it when a plan comes together