Rotate view angle of camera

Hi,
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:
renderer.GetActiveCamera().Azimuth(30)

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:
renderer.GetActiveCamera().GetDistance()

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!

Benny

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.