Are there any reasons why running TCanvas method HandleInput(kButton1Motion, x, y)
have different behaviour for perspective and parallel modes when TGeoManager geometry is shown?
In the perspective mode all seems to be made “the natural” way, while in the parallel mode x and y seem to be swapped.
I am running root 5, both Linux and Windows versions have the same issue.
I implemented the “perspective view” in the TView3D more than 10 years ago, on top of an existing implementation supporting the parallel view. The two have different concepts of scene/view/camera and are not very compatible (in terms of view angles). My objective at the time was to preserve the functionality of the parallel view while making a more realistic view for the perspective. As you noticed, the first would need some review and tuning - I’ve had a look but this is not trivial. Anyway the code is located in TView3D::ExecuteRotateView
I will try to provide the "minimum explanation"
We use ROOT as a library in a package developed using Qt framework.
There we create a ROOT application: TApplication RootApp("My ROOT", &rootargc, rootargv);
and put gSystem->ProcessEvents();
to trigger every 100 ms.
Over a window, containing TCanvas, we catch mouseMoveEvent(QMouseEvent *event)
and forward, in particular, rotations of the view using fCanvas->HandleInput(kButton1Motion, event->x(), event->y());
Here comes the problem I have described:
In the perspective view everything works as expected,
while in the parallel mode x and y controls are swapped.
I have tried to fix the behavior by swapping event->x() and event->y() in the HandleInput call,
and it further needed an inversion in the sign of both. But this fix is not pretty - the behavior
depends on where the user clicks and starts the drag.