hello
Try this
set display mode 800,600,32
sync on
REMSTART
:)
UPKEY - move object
DOWNKEY-move backwards
LEFT KEY-turn object left
RIGHT KEY-turn object right
mouse to LEFT SIDE of screen or RIGHT SIDE of screen will change the follow cameras angle on the object
mouse to TOP or BOTTOM of screen will change the follow cameras height
mouse wheel movement will change the distance of the follow camera
LEFT CLICK Will allow twisting of the follow camera
RIGHT CLICK Will give a 10 second slow motion effect to the scene
REMEND
REM THIS is the example world (the matrix is positioned half left and half back to bring its center to the Volumetric worlds center)
make matrix 1,1000,1000,100,100
position matrix 1,-500,0,-500
REM THIS is the hero (!)
make object sphere 1,20
rem HERO POSITION
obx#=0
oby#=11
obz#=0
position object 1,obx#,oby#,obz#
REM HEROS MOVEMENT SPEED
hms#=1
REM HEROS FACING ANGLE
hfa#=0
rem CAMERA MOVING SPEED
cams#=1.2
REM CAMERAS -->POSITION<-- ANGLE
apoy#=270
REM CAMERA ZOOM
cazo#=30
REM CAMERAS HEIGHT
cahe#=10
REM CAMERAS POSITION CALCULATIONS
cpx#=cos(apoy#)*cazo#+obx#
cpy#=cahe#
cpz#=sin(apoy#)*cazo#+obz#
position camera cpx#,cpy#,cpz#
rem ZOOM CONTROL (previous mousewheel value)
prez=mousez()
REM EXTRA ABILITIES
rem temporary starting angle for mousescan on camera twist
staa#=0
rem MOVEMENT DIVIDER (slowmotion effect)
modi#=1
rem SLOMOTION TIMERS
rem STARTING NOW DIFFERENCE AND LIMITER and INIT
timsta=0
timnow=0
timdif=0
timlim=10000
timini=0
rem kick
kik#=100
rem kikstep
kiks#=0.001
kikb#=0.0004
do
if timini=1
timnow=timer()
timdif=timnow-timsta
modi#=modi#-kiks#
kiks#=kiks#+kikb#
if modi#<1 then modi#=1
rem if its in limit
if timdif>timlim
modi#=1
timini=0
endif
endif
REM MOUSECONTROL RETURN VARIABLES coordinates and clicks and wheel
mx=mousex()
my=mousey()
mz=mousez()
mc=mouseclick()
if mc=0
REM CAMERA CONTROLS
rem if the mouse is on the right part of the screen , then turn camera
if mx>=760 and mx<=800
apoy#=apoy#+cams#/modi#
if apoy#>340 then apoy#=340
endif
rem if the mouse is on the left part of the screen ,then turn camera
if mx>=0 and mx<=40
apoy#=apoy#-cams#/modi#
if apoy#<200 then apoy#=200
endif
rem if mouse is on the top part of the screen , then lift camera
if my>=0 and my<=40
cahe#=cahe#+cams#/modi#
if cahe#>60 then cahe#=60
endif
rem if mouse is on the bottom part of the screen , then drop camera
if my>=560 and my<=600
cahe#=cahe#-cams#/modi#
if cahe#<4 then cahe#=4
endif
clikin=0
endif
REM IF MOUSEWHEEL CHANGED
if mz<>prez
REM IF ITS BIGGER NOW
if mz<prez
cazo#=cazo#+cams#/modi#
if cazo#>100 then cazo#=100
endif
REM IF ITS SMALLER NOW
if mz>prez
cazo#=cazo#-cams#/modi#
if cazo#<5 then cazo#=5
endif
prez=mz
endif
REM HEROS CONTROL KEYS (the arrows)
upk=upkey()
dok=downkey()
lek=leftkey()
rik=rightkey()
rem HERO MOVEMENT
if upk=1
move object 1,hms#/modi#
endif
if dok=1
move object 1,hms#*(-1)/modi#
endif
if rik=1
hfa#=hfa#-hms#/modi#
turn object right 1,hms#/modi#
endif
if lek=1
hfa#=hfa#+hms#/modi#
turn object left 1,hms#/modi#
endif
oay#=wrapvalue(hfa#)
REM GRAB OBJECTS POSITION FOR CALCULATIONS
obx#=object position x(1)
oby#=object position y(1)
obz#=object position z(1)
REM GRAB OBJECTS ANGLE FOR CALCULATIONS
cpx#=cos(wrapvalue(apoy#+oay#))*cazo#+obx#
cpy#=cahe#
cpz#=sin(wrapvalue(apoy#+oay#))*cazo#+obz#
position camera cpx#,cpy#,cpz#
point camera obx#,oby#,obz#
REM EXTRA CAMERA ABILITIES
REM ON LEFT CLICK IT ROTATES Z
if mc=1
rem if the click is continued
if clikin=1
rem get angle difference
dx=mx-400
dy=300-my
an#=wrapvalue(atanfull(dy,dx))
nowa#=an#
diff#=wrapvalue(staa#-nowa#)
zrotate camera diff#
endif
rem if this is the initial click set the angle
if clikin=0
rem get starting angle
dx=mx-400
dy=300-my
an#=wrapvalue(atanfull(dy,dx))
staa#=an#
clikin=1
endif
endif
REM ACTIVATE SLOW MOTION
if mc=2
timini=1
timsta=timer()
kiks#=0.05
modi#=kik#
endif
text 100,100,str$(modi#)
sync
loop
UPKEY - move object
DOWNKEY-move backwards
LEFT KEY-turn object left
RIGHT KEY-turn object right
mouse to LEFT SIDE of screen or RIGHT SIDE of screen will change the follow cameras angle on the object
mouse to TOP or BOTTOM of screen will change the follow cameras height
mouse wheel movement will change the distance of the follow camera
LEFT CLICK Will allow twisting of the follow camera
RIGHT CLICK Will give a 10 second slow motion effect to the scen