Index: trunk/geant4/visualization/OpenGL/include/G4OpenGLQtViewer.hh
===================================================================
--- trunk/geant4/visualization/OpenGL/include/G4OpenGLQtViewer.hh	(revision 711)
+++ trunk/geant4/visualization/OpenGL/include/G4OpenGLQtViewer.hh	(revision 712)
@@ -112,7 +112,9 @@
   QPoint fLastPos;
   /** delta of scene translation. This delta is put in % of the scene view */
-  float fDeltaSceneTranslation;
-  /** delta of left right move. This delta is put in % of the scene view */
-  float fDeltaZoom;
+  G4double fDeltaSceneTranslation;
+  /** delta of depth move. This delta is put in % of the scene view */
+  G4double fDeltaDepth;
+  /** delta of zoom move. This delta is put in % of the scene view */
+  G4double fDeltaZoom;
   /** To ensure key event are keep one by one */
   bool holdKeyEvent;
Index: trunk/geant4/visualization/OpenGL/include/G4OpenGLViewer.hh
===================================================================
--- trunk/geant4/visualization/OpenGL/include/G4OpenGLViewer.hh	(revision 711)
+++ trunk/geant4/visualization/OpenGL/include/G4OpenGLViewer.hh	(revision 712)
@@ -73,4 +73,7 @@
   void spewWireframeEPS (FILE*, GLint, GLfloat*, const char*);
   void print3DcolorVertex(GLint, GLint*, GLfloat*);
+  GLdouble getSceneNearWidth();
+  GLdouble getSceneFarWidth();
+  GLdouble getSceneDepth();
   G4float                           pointSize;
   char                              print_string[50];
Index: trunk/geant4/visualization/OpenGL/src/G4OpenGLQtViewer.cc
===================================================================
--- trunk/geant4/visualization/OpenGL/src/G4OpenGLQtViewer.cc	(revision 711)
+++ trunk/geant4/visualization/OpenGL/src/G4OpenGLQtViewer.cc	(revision 712)
@@ -287,6 +287,7 @@
   ,fContextMenu(0)
   ,fMouseAction(STYLE1)
-  ,fDeltaSceneTranslation(1/100)
-  ,fDeltaZoom(1.1)
+  ,fDeltaSceneTranslation(0.01)
+  ,fDeltaDepth(0.01)
+  ,fDeltaZoom(0.1)
   ,holdKeyEvent(false)
 {
@@ -1395,51 +1396,12 @@
 void G4OpenGLQtViewer::G4MouseMoveEvent(int dx, int dy, int dz)
 {
-//               2
-//         ------------       0              0              tx
-//         right - left
-//                            2
-//             0         ------------        0              ty
-//                       top - bottom
-//                                           -2
-//             0              0         ------------        tz
-//                                       zFar-zNear
-//             0              0              0              1
-//        where
-//                        tx = - (right + left) / (right - left)
-//                        ty = - (top + bottom) / (top - bottom)
-//                        tz = - (zFar + zNear) / (zFar - zNear)
- double              projection_view[16];
- glGetDoublev (GL_PROJECTION_MATRIX, projection_view);
- printf("%f\t%f\t%f\t%f\n",projection_view[0],projection_view[1],projection_view[2],projection_view[3]);
- printf("%f\t%f\t%f\t%f\n",projection_view[4],projection_view[5],projection_view[6],projection_view[7]);
- printf("%f\t%f\t%f\t%f\n",projection_view[8],projection_view[9],projection_view[10],projection_view[11]);
- printf("%f\t%f\t%f\t%f\n",projection_view[12],projection_view[13],projection_view[14],projection_view[15]);
-//   int deltaX = 
-// GLenum clip = glGet(GL_CLIP_PLANE);
-//   int deltaY = ;
-
-
-  G4Point3D stp = GetSceneHandler()->GetScene()->GetStandardTargetPoint();
-  
-  G4Point3D tp = stp + fVP.GetCurrentTargetPoint ();
-  
-  const G4Vector3D& upVector = fVP.GetUpVector ();
-  const G4Vector3D& vpVector = fVP.GetViewpointDirection ();
-  
-  G4Vector3D unitRight = (upVector.cross (vpVector)).unit();
-  G4Vector3D unitUp    = (vpVector.cross (unitRight)).unit();
-  
-#ifdef GEANT4_QT_DEBUG
-  G4cout << fVP<<G4endl;
-  printf("Mouse event Target Point : %f %f %f\n",tp.x(),tp.y(),tp.z());
-  printf("Mouse event upVector : %f %f %f\n",upVector.x(),upVector.y(),upVector.z());
-  printf("Mouse event vpVector Point : %f %f %f\n",vpVector.x(),vpVector.y(),vpVector.z());
-  printf("Mouse event unitRight Point : %f %f %f\n",unitRight.x(),unitRight.y(),unitRight.z());
-  printf("Mouse event unitUp Point : %f %f %f\n",unitUp.x(),unitUp.y(),unitUp.z());
-#endif
-  tp += -dx * unitRight + dy * unitUp + dz * vpVector;
-  fVP.SetCurrentTargetPoint (tp - stp);
-  
-  updateQWidget();
+  GLdouble coefTrans = getSceneNearWidth()*fDeltaSceneTranslation;
+  GLdouble coefDepth = getSceneDepth()*fDeltaDepth;
+
+  printf("Increment : %f %f\n",getSceneNearWidth(),getSceneDepth());
+  printf("Increment : %f %f %f \n",-dx*coefTrans,dy*coefTrans,dz*coefDepth);
+ fVP.IncrementPan(-dx*coefTrans,dy*coefTrans,dz*coefDepth);
+ 
+ updateQWidget();
 }
 
@@ -1807,4 +1769,8 @@
   if ((event->key() == Qt::Key_Down) && (event->modifiers() & Qt::AltModifier )) { // go backward
 #endif
+#ifdef GEANT4_QT_DEBUG
+    printf("Alt + Down!!\n");
+#endif
+    
     G4MouseMoveEvent(0,0,1);
   }
@@ -1813,4 +1779,7 @@
 #else
   else if ((event->key() == Qt::Key_Up) && (event->modifiers() & Qt::AltModifier)) { // go forward
+#endif
+#ifdef GEANT4_QT_DEBUG
+    printf("Alt + Up!!\n");
 #endif
     G4MouseMoveEvent(0,0,-1);
@@ -1848,13 +1817,16 @@
   }
   if (event->key() == Qt::Key_Plus) { // zoom in
-    fVP.SetZoomFactor(fVP.GetZoomFactor()*fDeltaZoom); 
+    fVP.SetZoomFactor(fVP.GetZoomFactor()*(1+fDeltaZoom)); 
     updateQWidget();
   }
   else if (event->key() == Qt::Key_Minus) { // zoom out
-    fVP.SetZoomFactor(fVP.GetZoomFactor()/fDeltaZoom); 
+    fVP.SetZoomFactor(fVP.GetZoomFactor()*(1-fDeltaZoom)); 
     updateQWidget();
   }
   // with no modifiers
   if (!event->modifiers()) {
+#ifdef GEANT4_QT_DEBUG
+    printf("No modifier !!\n");
+#endif
     if (event->key() == Qt::Key_Down) { // go down
       G4MouseMoveEvent(0,1,0);
Index: trunk/geant4/visualization/OpenGL/src/G4OpenGLViewer.cc
===================================================================
--- trunk/geant4/visualization/OpenGL/src/G4OpenGLViewer.cc	(revision 711)
+++ trunk/geant4/visualization/OpenGL/src/G4OpenGLViewer.cc	(revision 712)
@@ -196,4 +196,5 @@
   }
   
+  printf("Set view to : %f %f %f %f %f %f \n",left, right, bottom, top, pnear, pfar);
   glMatrixMode (GL_MODELVIEW); // apply further transformations to scene.
   glLoadIdentity();
@@ -724,4 +725,43 @@
 }
 
+GLdouble G4OpenGLViewer::getSceneNearWidth()
+{
+  const G4Point3D targetPoint
+    = fSceneHandler.GetScene()->GetStandardTargetPoint()
+    + fVP.GetCurrentTargetPoint ();
+  G4double radius = fSceneHandler.GetScene()->GetExtent().GetExtentRadius();
+  if(radius<=0.) radius = 1.;
+  const G4double cameraDistance = fVP.GetCameraDistance (radius);
+  const GLdouble pnear   = fVP.GetNearDistance (cameraDistance, radius);
+  return 2 * fVP.GetFrontHalfHeight (pnear, radius);
+}
+
+GLdouble G4OpenGLViewer::getSceneFarWidth()
+{
+  const G4Point3D targetPoint
+    = fSceneHandler.GetScene()->GetStandardTargetPoint()
+    + fVP.GetCurrentTargetPoint ();
+  G4double radius = fSceneHandler.GetScene()->GetExtent().GetExtentRadius();
+  if(radius<=0.) radius = 1.;
+  const G4double cameraDistance = fVP.GetCameraDistance (radius);
+  const GLdouble pnear   = fVP.GetNearDistance (cameraDistance, radius);
+  const GLdouble pfar    = fVP.GetFarDistance  (cameraDistance, pnear, radius);
+  return 2 * fVP.GetFrontHalfHeight (pfar, radius);
+}
+
+
+GLdouble G4OpenGLViewer::getSceneDepth()
+{
+  const G4Point3D targetPoint
+    = fSceneHandler.GetScene()->GetStandardTargetPoint()
+    + fVP.GetCurrentTargetPoint ();
+  G4double radius = fSceneHandler.GetScene()->GetExtent().GetExtentRadius();
+  if(radius<=0.) radius = 1.;
+  const G4double cameraDistance = fVP.GetCameraDistance (radius);
+  const GLdouble pnear   = fVP.GetNearDistance (cameraDistance, radius);
+  return fVP.GetFarDistance  (cameraDistance, pnear, radius)- pnear;
+}
+
+
 void G4OpenGLViewer::spewSortedFeedback(FILE * file, GLint size, GLfloat * buffer)
 {
Index: trunk/geant4/visualization/management/include/G4ViewParameters.hh
===================================================================
--- trunk/geant4/visualization/management/include/G4ViewParameters.hh	(revision 711)
+++ trunk/geant4/visualization/management/include/G4ViewParameters.hh	(revision 712)
@@ -210,5 +210,10 @@
   void SetLightsMoveWithCamera (G4bool moves);
   void SetPan                  (G4double right, G4double up);
+  /** Increment currentTarget point by following X,Y values
+   */
   void IncrementPan            (G4double right, G4double up);
+  /** Increment currentTarget point by following X,Y,Z values
+   */
+  void IncrementPan            (G4double right, G4double up, G4double distance);
   void SetDefaultVisAttributes (const G4VisAttributes&);
   void SetDefaultTextVisAttributes (const G4VisAttributes&);
Index: trunk/geant4/visualization/management/src/G4ViewParameters.cc
===================================================================
--- trunk/geant4/visualization/management/src/G4ViewParameters.cc	(revision 711)
+++ trunk/geant4/visualization/management/src/G4ViewParameters.cc	(revision 712)
@@ -233,7 +233,11 @@
 
 void G4ViewParameters::IncrementPan (G4double right, G4double up) {
+  IncrementPan (right,up, 0);
+}
+
+void G4ViewParameters::IncrementPan (G4double right, G4double up, G4double distance) {
   G4Vector3D unitRight = (fUpVector.cross (fViewpointDirection)).unit();
   G4Vector3D unitUp    = (fViewpointDirection.cross (unitRight)).unit();
-  fCurrentTargetPoint += right * unitRight + up * unitUp;
+  fCurrentTargetPoint += right * unitRight + up * unitUp + distance * fViewpointDirection;
 }
 
