TGLCamera ortho projections

Hello,

I cannot represent a detector with the correct orientation by using the provided projections in TGLOrthoCamera XOY, XOZ and YOZ. I would need a YOX and a ZOX projection.
I tried to project and then rotate (RotateRad() or Rotate() methods) but the rotation doesn’t occur around the projected plane (e.g for the XOY projection I would ned to rotate about z). See attached picture.


Is there a way to do this?

Thanks,
Sebastien


ROOT 6.10/08 mac os 10.13.4


Could it be one of those works for you?

You could also enable arc-ball rotation through (a key in viewer):
TGLViewer—>GetEventHandler()->SetArcBall(true);
This ignores the “up” direction and always rotates around current view axes.

Cheers,
Matevz

Hello Matevz,
unfortunately kXnOY I had tried but it gives me a 180° rotation (I need a 90° rotation). I also tried with SetArcBall(True) and all possible combinations of rotations but no success (see the image).
I would essentially need a projection with “Looking along Z axis, X vert, Y horz”. Is it not possible for the user to define his own projection by inputing two TGLVector3? I guess this would be the simplest.
Thanks,

ok finally got it
v1=TGLVector3(0,0,-1)
v2=TGLVector3(1,0,0)
myProj.GetGLViewer().ReinitializeCurrentCamera(v1_zoy,v2_zoy,True)
(maybe good anyhow to have the possibility to directly make your projection camera from the start, it took me some time!)

Thanks,

Yay, I’m glad you worked it out.

I agree the current camera system is bit silly … will try to do better for root-7, with arbitrary list of user specified (and named) cameras one can create (through enums or by specifying vectors) and swap in a useful manner.

Matevz

this would be nice indeed, thanks

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