Changing Camera Axes in Eve7

Hi all, I’m an undergrad researcher working on a project in Eve7. This is my first time using ROOT/Eve7 on a project, and everything’s been working smoothly so far, except I’m running into a problem with setting/changing the camera orientation. Is there a way to rotate the camera or make it so that the z axis points upwards rather than to the right? I tried to replicate the solution I saw in another thread about changing the camera axes in Eve, but it seems like it doesn’t work in Eve7. Any guidance is appreciated.

Thanks so much,
Theo

ROOT Version: 6.36.000
Platform: macOS Sequoia 15.5
Compiler: Not Provided


Try with TView::RotateView(), e.g.

  TView *view = gPad->GetView();
  cout<<view->GetLongitude()<<" "<<view->GetLatitude()<<" "<<view->GetPsi()<<endl;  // see current values; longitude = phi, latitude = theta
  view->RotateView(-30, 60);

If you want to rotate in psi as well (see printout from the above), you can do what is done by ROOT in the page I linked above: get the view and then manually do SetView (instead of RotateView) with psi different from zero, and also adjust the Pad as shown there too.

gPad and TView are not used with Eve7.
I hope @alja or @matevz can help here.

@jtheo @linev @matevz

Hi Theo

For the moment, there are only two camera types that can be set in REveViewer: kCameraPerspXOZ, kCameraOrthoXOY [1].

To my understanding, you need a CameraPerspXOY type. I will add this type with the other missing camera types (kCameraPerspYOZ, kCameraPerspYOZ, kCameraOrthoXOZ, kCameraOrthoZOY,kCameraOrthoXnOY, kCameraOrthoXnOZ, kCameraOrthoZnOY, kCameraOrthoZnOX)

Thank you for the report!

Alja

[1] root/graf3d/eve7/inc/ROOT/REveViewer.hxx at master · root-project/root · GitHub

1 Like

Thanks all so much for the quick replies. @Alja when do you think the other camera types would be available to use? No rush or anything, just curious.

Best,
Theo

@jtheo

I will make a PR to the main branch within this week.
Here is the commit that changes the camera direction so that the Z axis is the camera’s up axis.

Do you need this addition in a specific release?

Alja

@alja

Thanks for letting me know. If it could be made a part of the newest ROOT release, that would be great.

Thanks again,

Theo

Just for info. The pending PR is here [reve] Additional Perspective and Orthographic camera types by alja · Pull Request #19661 · root-project/root · GitHub.

1 Like