Rotate view angle of camera

I know that this topic seems simple but however I am getting an unexpected result from it.
My process looks like this:

  • Using the vtkOBJReader to read an obj file
  • Actor -> vtkRenderer -> vtkRenderWindow -> vtkRenderWindowInteractor->Rendering

It all works fine, the camera position is perfect for the model. Now I would like so slightly change the view angle towards the model (like an isometric view instead of the “view from right” perspective).
So I tried:

However, the result is that the camera is positioned inside the model (I guess at [0,0,0]).
Afterwards I just tried to get the distance using:

But this command is also putting the camera position inside the model. To me, this is not the expected case since the GetDistance() method should be an exclusive “getter” method, so why would it reset the camera’s position?

Or am I missing something?

Thanks already for the effort!


vtkCamera::GetDistance() looks like just an accessory method. Does calling renderer.GetActiveCamera() changes the camera position or you need to call its GetDistance() method?

Anyway, you can use ResetCamera method anytime to reset the camera’s field of view.