That's a good start. I prefer to do the camera stuff myself:
The globals:
`camera
global AngleY# as float = 45.0
global AngleX# as float = 45.0
global CameraDistance# as float =100.0
global CameraX# as float =0.0
global CameraY# as float =0.0
global CameraZ# as float =0.0
The function
function RotateCamera()
RotateTarget=0
MX# as float
MX#=MOUSEMOVEX()
MY# as float
MY#=MOUSEMOVEY()
if (MOUSECLICK() && 2)
AngleY#=wrapvalue(AngleY#+(MX#/5.0))
AngleX#=(AngleX#+(MY#/5.0))
Drag=1
else Drag=0
endif
if AngleX#>70.0 then AngleX#=70.0
if AngleX#<-70.0 then AngleX#=-70.0
CameraDistance#=CameraDistance#+MouseScroll
if CameraDistance#>1000.0 then CameraDistance#=1000.0
if CameraDistance#<10.0 then CameraDistance#=10.0
position camera CameraX#,CameraY#+5.0,CameraZ# `the lookat point
rotate camera AngleX#,AngleY#,0.0
move camera -CameraDistance#
endfunction
The fastest code is the code never written.