About 3D globe--How the rotate view works

Hi guys,
  I am learning to build a 3D globe earth.
  However now I meet a problem. I can realize 'pan view' and 'zoom view' two operations, but I don't know how to realize 'rotate view' operation.
  I really want to know the specific code and function about the rotate view. If this function is realized by a plug-in, I also want to know all about the plug-in.
  Any help is welcome!
  Thx!