View Full Version : Trackball and panning

10-29-2003, 03:07 AM
Hi !

Is anybody has an example of mixing trackball (rotation with mouse on virtual sphere and quaternions) and simple pan (translate scene with the mouse) ?
I get ugly results with rotating around wrong axe when I translate my model.
The rotation is around old center and not around new center.
I tried all orders for the matrix (rotate/translate and translate/rotate).

Thanks !

10-29-2003, 05:15 AM
Try this (matrices are left multiplied in OpenGL, read from bottom to top.)

+translate (to object location)
rotate (in origin)
-translate (moves center of rotation to origin)
draw object

10-29-2003, 10:33 PM
I found it !
My camera works properly now !
It was a mistake for evaluate the "world" vector during panning.
Thank you !