MantisBT - VTK
View Issue Details
0009738VTK(No Category)public2009-10-20 04:202016-08-12 09:55
edice 
Kitware Robot 
normalmajoralways
closedmoved 
 
 
0009738: vtkInteractorStyleTerrain confused by FlyTo()
Set the interactor style to Terrain.
Set the camera like so:
  ren->GetActiveCamera()->SetPosition(1,1,0);
  ren->GetActiveCamera()->SetFocalPoint(0,0,0);
  ren->GetActiveCamera()->SetViewUp(0,0,1);

View a model.

Confirm that you cannot rotate the model all the way past the 'up' axis, the most you can go is to look directly down onto the model. That is a terrible description but I hope you get the gist.

Angle the model so you look at it from above, say from 45 degrees.
Press 'f' to fly to a point in the model.

The camera's Up is now no longer 0,0,1. This screws up Terrain, now if you move the mouse up and down, you will go "over the top" of the model, rather than stopping at looking directly down on the model.

To "fix" this, I have had to do the following:


class CameraUp_Callback : public vtkCommand
{
public:
   virtual void Execute(vtkObject * caller, unsigned long, void*)
   {
      vtkRenderer * ren = vtkRenderer::SafeDownCast(caller);
      vtkCamera * camera = ren->GetActiveCamera();
      if (camera)
      {
         double * view = camera->GetViewUp();
         if (view[0] != 0 and view[1] != 0 and view[2] != 1)
            camera->SetViewUp(0,0,1);
      }
   }
};



ren->AddObserver(vtkCommand::ResetCameraClippingRangeEvent, new CameraUp_Callback);
No tags attached.
Issue History
2009-10-20 04:20ediceNew Issue
2011-06-16 13:11Zack GalbreathCategory => (No Category)
2016-08-12 09:55Kitware RobotNote Added: 0037109
2016-08-12 09:55Kitware RobotStatusexpired => closed
2016-08-12 09:55Kitware RobotResolutionopen => moved
2016-08-12 09:55Kitware RobotAssigned To => Kitware Robot

Notes
(0037109)
Kitware Robot   
2016-08-12 09:55   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current VTK Issues page linked in the banner at the top of this page.