Ah, I forgot to factor in the fact the MOUSEMOVEY clears its value when you read it once...I'll just write it in your code so I can make sure I do it right
make object plane 1,25,.5
position object 1,0,0,0
make object cylinder 2,3
position object 2,0,1,5
do
ControlCamera( 0.05 )
loop
function ControlCamera( velocity# as float )
camXSpd# = keystate(17) - keystate(31) : camXSpd# = camXSpd# * velocity#
camZSpd# = keystate(30) - keystate(32) : camZSpd# = camZSpd# * velocity#
camYSpd# = keystate(16) - keystate(18) : camYSpd# = camYSpd# * velocity#
x# = camera position x() : y# = camera position y() : z# = camera position z()
yrotate camera wrapvalue( camera angle y() + mousemovex() / 2.0 )
`90 and 270 are the boundaries for the camera rotation in this case
`If the camera rotates out of those boundaries, the program sets it to the closest boundary
temp= wrapvalue( camera angle x() + mousemovey() / 2.0 )
if temp > 270
xrotate camera temp
else
if temp >= 180 then xrotate camera 270
endif
if temp < 90
xrotate camera temp
else
if temp < 180 then xrotate camera 90
endif
ny# = y# - camYSpd#
nx# = x# + camXSpd# * sin( camera angle y() ) + camZSpd# * sin( camera angle Y() - 90.0 )
nz# = z# + camXSpd# * cos( camera angle y() ) + camZSpd# * cos( camera angle Y() - 90.0 )
position camera (nx#), (ny#), (nz#)
endfunction
If you have any questions about it, please ask
.