Well my code does:
Place the camera behind the player.
Keep the same panning.
Rotate the camera when i rightclick the mouse button and rotates the direction u go with your mouse.
the code u passed does:
place the camera on the plyers x y z so im inside the player.
doesn't keep same panning.
Doesnt rotate the camera according the mouse force
And looks up to the sky.
So my code is almost there the only thing is the tilting and panning.
Panning u can compare to the camera of World of warcraft im trying to get something like that.
greetzzz. hope u understand if not i will make an example.