Problem 120 - Behaviour of UpVector when rotating object
Summary: Behaviour of UpVector when rotating object
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: visualization (show other problems)
Version: 2.0
Hardware: All All
: P2 enhancement
Assignee: John.Allison
URL:
Depends on:
Blocks:
 
Reported: 2000-07-05 02:29 CEST by V.Hejny
Modified: 2001-01-25 05:31 CET (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
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.