Have a look to this piece of code of DTC forum.
make object cube 1,50
position object 1,1250,25,1250
Rem world
color backdrop rgb(0,0,0)
set point light 0,1250,500,1250
color light 0,rgb(255,255,255)
set light range 0,2500
fog on
fog color 0,0,0
fog distance 1000
make matrix 3,2500,2500,15,15
groundheight#=50
do
Rem player rotate
rotate#=object angle y(1)+(mousemovex()/2)
yrotate object 1,rotate#
Rem player movement
if leftkey() then left#=curvevalue(20.0,left#,10.0)
if rightkey() then right#=curvevalue(20.0,right#,10.0)
if upkey() then move#=curvevalue(20.0,move#,10.0)
if downkey() then move#=curvevalue(-10.0,move#,10.0)
move object 1,move#
move object left 1,left#
move object right 1,right#
move#=curvevalue(0.0,move#,15.0)
left#=curvevalue(0.0,left#,15.0)
right#=curvevalue(0.0,right#,15.0)
set cursor 0,0
print "height angle ",ax#
print "rotation angle ",ay#
print "fps ",screen fps()
rem camera position
x# = object position x(1)
y# = object position y(1)
z# = object position z(1)
ay# = object angle y(1)
ax#=ax#+(mousemovey()/2)
if ax#>-25 and ax#<45 then look#=ax#
ax#=look#
y#=y#+groundheight#
sx#=camera position x()
sy#=camera position y()
sz#=camera position z()
cx# = x#+150*cos(ax#)*sin(ay#)*-1
cy# = y#+150*sin(ax#)
cz# = z#+150*cos(ax#)*cos(ay#)*-1
position camera curvevalue(cx#,sx#,10),curvevalue(cy#,sy#,10),curvevalue(cz#,sz#,5)
point camera x#,y#,z#
cr#=camera angle x()
print "camera angle ",cr#
sync
loop
Cheers.
I'm not a grumpy grandpa