Index: trunk/packages/vizservers/vtkvis/RpVtkRenderer.cpp
===================================================================
--- trunk/packages/vizservers/vtkvis/RpVtkRenderer.cpp	(revision 2218)
+++ trunk/packages/vizservers/vtkvis/RpVtkRenderer.cpp	(revision 2222)
@@ -1636,5 +1636,5 @@
 }
 
-void Renderer::setSceneOrientation(double quat[4])
+void Renderer::setCameraOrientation(double quat[4])
 {
     vtkSmartPointer<vtkCamera> camera = _renderer->GetActiveCamera();
@@ -1646,15 +1646,32 @@
         memcpy((*mat4)[r], mat3[r], sizeof(double)*3);
     }
+    TRACE("Arcball camera matrix: %g %g %g %g %g %g %g %g %g",
+          (*mat4)[0][0], (*mat4)[0][1], (*mat4)[0][2],
+          (*mat4)[1][0], (*mat4)[1][1], (*mat4)[1][2],
+          (*mat4)[2][0], (*mat4)[2][1], (*mat4)[2][2]);
+    camera->SetPosition(0, 0, 1);
+    camera->SetFocalPoint(0, 0, 0);
+    camera->SetViewUp(0, 1, 0);
+    camera->SetViewAngle(30);
+    _renderer->ResetCamera();
+    camera->GetFocalPoint(_cameraFocalPoint);
     trans->Translate(+_cameraFocalPoint[0], +_cameraFocalPoint[1], +_cameraFocalPoint[2]);
     trans->Concatenate(mat4);
     trans->Translate(-_cameraFocalPoint[0], -_cameraFocalPoint[1], -_cameraFocalPoint[2]);
-    camera->SetPosition(0, 0, 1);
-    camera->SetFocalPoint(0, 0, 0);
-    camera->SetViewUp(0, 1, 0);
     camera->ApplyTransform(trans);
     storeCameraOrientation();
+    if (_cameraZoomRatio != 1.0) {
+        double z = _cameraZoomRatio;
+        _cameraZoomRatio = 1.0;
+        zoomCamera(z, true);
+    }
     if (_cameraPan[0] != 0.0 || _cameraPan[1] != 0.0) {
-        panCamera(_cameraPan[0], _cameraPan[1], true);
-    }
+        double panx = _cameraPan[0];
+        double pany = -_cameraPan[1];
+        _cameraPan[0] = 0;
+        _cameraPan[1] = 0;
+        panCamera(panx, pany, true);
+    }
+    printCameraInfo(camera);
     _needsRedraw = true;
 }
@@ -1681,4 +1698,8 @@
 }
 
+/**
+ * \brief Saves the current camera orientation and position in order to
+ * be able to later restore the saved orientation and position
+ */
 void Renderer::storeCameraOrientation()
 {
@@ -1689,4 +1710,8 @@
 }
 
+/**
+ * \brief Use the stored orientation and position to set the camera's
+ * current state
+ */
 void Renderer::restoreCameraOrientation()
 {
@@ -1704,9 +1729,9 @@
 void Renderer::resetCamera(bool resetOrientation)
 {
+    vtkSmartPointer<vtkCamera> camera = _renderer->GetActiveCamera();
     if (_cameraMode == IMAGE) {
         initCamera();
     } else {
         if (resetOrientation) {
-            vtkSmartPointer<vtkCamera> camera = _renderer->GetActiveCamera();
             camera->SetPosition(0, 0, 1);
             camera->SetFocalPoint(0, 0, 0);
@@ -1716,8 +1741,12 @@
             restoreCameraOrientation();
         }
+        camera->SetViewAngle(30);
         _renderer->ResetCamera();
         _renderer->ResetCameraClippingRange();
         computeScreenWorldCoords();
     }
+
+    printCameraInfo(camera);
+
     _cameraZoomRatio = 1;
     _cameraPan[0] = 0;
@@ -1761,4 +1790,7 @@
 void Renderer::panCamera(double x, double y, bool absolute)
 {
+    TRACE("Enter panCamera: %g %g, current abs: %g %g",
+          x, y, _cameraPan[0], _cameraPan[1]);
+
     if (_cameraMode == IMAGE) {
         // Reverse x rather than y, since we are panning the camera, and client
@@ -1837,4 +1869,8 @@
         computeScreenWorldCoords();
     }
+
+    TRACE("Leave panCamera: %g %g, current abs: %g %g",
+          x, y, _cameraPan[0], _cameraPan[1]);
+
     _needsRedraw = true;
 }
@@ -1848,4 +1884,8 @@
 void Renderer::zoomCamera(double z, bool absolute)
 {
+    vtkSmartPointer<vtkCamera> camera = _renderer->GetActiveCamera();
+    TRACE("Enter Zoom: current abs: %g, z: %g, view angle %g",
+          _cameraZoomRatio, z, camera->GetViewAngle());
+
     if (absolute) {
         assert(_cameraZoomRatio > 0.0);
@@ -1856,4 +1896,5 @@
         _cameraZoomRatio *= z;
     }
+
     if (_cameraMode == IMAGE) {
         double dx = _imgWorldDims[0];
@@ -1868,5 +1909,4 @@
                             _imgWorldDims[0], _imgWorldDims[1]);
     } else {
-        vtkSmartPointer<vtkCamera> camera = _renderer->GetActiveCamera();
         camera->Zoom(z); // Change perspective FOV angle or ortho parallel scale
         //camera->Dolly(z); // Move camera forward/back
@@ -1874,4 +1914,8 @@
         storeCameraOrientation();
     }
+
+    TRACE("Leave Zoom: rel %g, new abs: %g, view angle %g", 
+          z, _cameraZoomRatio, camera->GetViewAngle());
+
     _needsRedraw = true;
 }
@@ -2223,6 +2267,7 @@
 void Renderer::printCameraInfo(vtkCamera *camera)
 {
-    TRACE("Parallel Scale: %g, Cam pos: %g %g %g, focal pt: %g %g %g, view up: %g %g %g, Clipping range: %g %g",
+    TRACE("Parallel Scale: %g, View angle: %g, Cam pos: %g %g %g, focal pt: %g %g %g, view up: %g %g %g, Clipping range: %g %g",
           camera->GetParallelScale(),
+          camera->GetViewAngle(),
           camera->GetPosition()[0],
           camera->GetPosition()[1],
Index: trunk/packages/vizservers/vtkvis/RpVtkRenderer.h
===================================================================
--- trunk/packages/vizservers/vtkvis/RpVtkRenderer.h	(revision 2218)
+++ trunk/packages/vizservers/vtkvis/RpVtkRenderer.h	(revision 2222)
@@ -110,5 +110,5 @@
     void rotateCamera(double yaw, double pitch, double roll);
 
-    void setSceneOrientation(double quat[4]);
+    void setCameraOrientation(double quat[4]);
 
     void setCameraOrientationAndPosition(double position[3],
Index: trunk/packages/vizservers/vtkvis/RpVtkRendererCmd.cpp
===================================================================
--- trunk/packages/vizservers/vtkvis/RpVtkRendererCmd.cpp	(revision 2218)
+++ trunk/packages/vizservers/vtkvis/RpVtkRendererCmd.cpp	(revision 2222)
@@ -251,5 +251,5 @@
     }
 
-    g_renderer->setSceneOrientation(quat);
+    g_renderer->setCameraOrientation(quat);
     return TCL_OK;
 }
