This is how I've done this. Use the middle mouse button to pan the camera and you can use the scroll wheel to zoom (if that's something you want to do).
sync on
sync rate 65
set window off
hide mouse
make matrix 1, 1000,1000,10,10
make object cube 1,10
position object 1, 500,0,500
facing# = 30.0
pitch# = 30.0
zoom# = -1000.0
do
`rotate camera if no buttons are being pressed
if mouseclick() = 0
facing# = wrapvalue(facing# + mousemovex())
yrotate object 1, facing#
pitch# = pitch# + mousemovey()
if pitch# < 0 then pitch# = 0
if pitch# > 90 then pitch# = 90
endif
`pan camera if middle mouse button is pressed
if mouseclick() = 4
move object 1, mousemovey()
move object right 1, mousemovex()
endif
`use scroll wheel to zoom in and out
zoom# = zoom# + mousemovez()
if zoom# > -10 then zoom# = -10
`position the camera on the cube and then rotate it in the desired fashion then move the camera backward
position camera object position x(1), object position y(1), object position z(1)
rotate camera 0,0,0
turn camera right facing#
pitch camera down pitch#
move camera zoom#
sync
loop
one of these days I'll come up with a better signature