Javadoc
The TrackBall
pretends that a ball encloses the 3d view. You roll this ball with the mouse. For example,
if you click on the center of the ball and move the ball directly right, you rotate around y. Click on edge of ball
and roll to get a z rotation.
The idea isn't too hard. Start with a vector from the first mouse click to the center of the 3d view. Set the radius
of the ball to the smaller dimension of the 3d view. As you drag around, a second vector is determined from the
surface to center of the ball. Axis of rotation is cross-product of those two vectors, and the angle is the angle
between the vectors.
This class was copied from a cpp file I once used in my Computer Graphic classes. I don't know who the original
author was, but since I only created the java representation of the working code, I would like to thank him/her.