Trackball C++ code without quaternions

I'm leaving some code to handle a simple trackball interface to move 3D objects around. Trackballs give an intuitive rotation given an input mouse motion: given a clicked point and a second point moving on the screen we compute a rotation (that you apply to some 3D object in the scene) that gives the user the impression of dragging a 3D ball where we first clicked on it.

The code actually wasn't done by me, but I can't remember where I took it! Originally it was C code which I've wrapped up in a C++ class with way more comments and an example of how to use it. [  C++ trackball code ].

No comments

(optional field, I won't disclose or spam but it's necessary to notify you if I respond to your comment)
All html tags except <b> and <i> will be removed from your comment. You can make links by just typing the url or mail-address.
Anti-spam question: