How to set the camera's orientation back to (0,0,0)?

Hello,I have tried like this:

print("Before ", renderer.GetActiveCamera().GetOrientation())

ori = renderer.GetActiveCamera().GetOrientation()
renderer.GetActiveCamera().Elevation(0 - ori[0])
renderer.GetActiveCamera().Azimuth(0 - ori[1])
renderer.GetActiveCamera().Roll(0 - ori[2])

print("After ", renderer.GetActiveCamera().GetOrientation())

got output like this:

Before (59.99999999999999, -29.999999999999993, 14.999999999999993)
After (-2.9765335378579105, -46.812392303903216, -8.130371568495393)

Obviously,it isn’t right,How to make it right?

GetOrientation just returns the position of the camera (x,y,z). Elevation, Azimuth, Roll use angles in degrees so you are treating the camera (x,y,z) position as angles here.

I have just created an example for you that shows you the correct way to do this (2.6 KB).

Here the cone is displayed in its original orientation for 1s then the new orientation for 1s and finally back to the original orientation. Then you can interact with it. Note that just position, focal point and view up are all you really need.

When I get time, I’ll add it to the vtk-examples.

FYI, more complete examples are now in vtk-examples:


Thanks very much