Problem 120

Summary: Behaviour of UpVector when rotating object
Product: Geant4 Reporter: V.Hejny
Component: visualizationAssignee: John.Allison
Status: RESOLVED FIXED    
Severity: enhancement CC: stanaka
Priority: P2    
Version: 2.0   
Hardware: All   
OS: All   

Description V.Hejny 2000-07-05 02:29:53 CEST
When using OpenGLXmViewer, the rotation control panel has the feature to
select between rotating the camera or the object. When moving the camera,
the UpVector for this view keeps constant, which is natural. But when
moving the object (i.e. move-lights-with-viewpoint enabled in the code),
this Vector keeps also constant relative to the object. I think, it should be
constant relative to the viewpoint. This would prevent flipping the object,
when reaching the opposite side of the UpVector.
I would suggest to add:

  if (pView->fVP.GetLightsMoveWithCamera()) {
    G4Vector3D new_up = (new_vp.cross(yprime)).unit();
    pView->fVP.SetUpVector(new_up);
  }

in line 146 of funtion
void G4OpenGLXmViewer::rotate_in_phi (XtPointer clientData,
                                    XtIntervalId* timer_id)

in file
visualization/OpenGL/src/G4OpenGLXmRotationCallbacks.cc

This keeps the UpVector pointing to the upper edge of the window relative
to the viewpoint (and therefore relative to the user in front of the screen).
Comment 1 John.Allison 2000-07-05 08:00:59 CEST
OK, this is a nice idea.  Let us think about it.
Comment 2 John.Allison 2001-01-25 05:31:59 CET
Fixed in tag opengl-V03-00-00.  This will hopefully make
the February reference tag.