TCanvas HandleInput method: perspective vs. parallel

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.

Regards,
Andrey

Hi,

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

Can you provide a small script showing this issue ?

Andrei showed me how to reproduce it. I will have a look.

I will try to provide the "minimum explanation"
We use ROOT as a library in a package developed using Qt framework.

  1. There we create a ROOT application:
    TApplication RootApp("My ROOT", &rootargc, rootargv);

  2. and put
    gSystem->ProcessEvents();
    to trigger every 100 ms.

  3. 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.

How else I can help in pinpointing the problem?

The problem is now fixed in master and 534-patches.

Thank you very much!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.