Luckily, I have a piece of code which does just that.
sync on
sync rate 30
hide mouse
autocam off
make matrix 1,1000,1000,5,5
x#=500
y#=0
z#=500
r#=500
h#=200
do
a#=wrapvalue(a#+mousemovex())
position camera x#+(cos(a#)*r#),y#+h#,z#+(sin(a#)*r#)
point camera x#,y#,z#
sync
loop
a# is the angle, automatically set to move with the mouse.
x# is the x coordinate of where you want to look.
y# is the y coordinate of where you want to look.
z# is the z coordinate of where you want to look.
r# is the distance away from the object along the floor.
h# is the height above the object.
Here is the same thing but in 3D!
sync on
sync rate 30
hide mouse
autocam off
make matrix 1,1000,1000,5,5
x#=500
y#=0
z#=500
r#=500
do
a#=wrapvalue(a#+mousemovex())
c#=c#+mousemovey()
if c#>89 then c#=89
if c#<-89 then c#=-89
b#=wrapvalue(c#)
position camera x#+(cos(a#)*r#*cos(b#)),y#+(sin(b#)*r#),z#+(sin(a#)*r#*cos(b#))
point camera x#,y#,z#
sync
loop
b# is the angle above the point you want to look at, automatically set to the mouse moving upwards.
c# is b#, but including some limits to make sure you can't move the camera too far over or under the object.
Notice this time h# is not needed.
Zelda's camera is slightly more complex, in that it automatically centres behind Link when he is running, and after you wait a while when standing. To do this, you would just set a# to the curveangle of the angle that the player is moving.
Once I was but the learner,
now, I am the Master.