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

**URL:** https://discourse.vtk.org/t/how-to-set-the-cameras-orientation-back-to-0-0-0/7984
**Category:** Support
**Created:** [March 5, 2022, 3:22pm UTC](https://discourse.vtk.org/t/how-to-set-the-cameras-orientation-back-to-0-0-0/7984 "2022-03-05T15:22:21Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![AlexLuya](https://discourse.vtk.org/user_avatar/discourse.vtk.org/alexluya/32/4036_2.png) [@AlexLuya](https://discourse.vtk.org/u/AlexLuya)
#### Post date: [March 5, 2022, 3:22pm UTC](https://discourse.vtk.org/t/how-to-set-the-cameras-orientation-back-to-0-0-0/7984/1 "2022-03-05T15:22:21Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![amaclean](https://discourse.vtk.org/user_avatar/discourse.vtk.org/amaclean/32/224_2.png) [@amaclean](https://discourse.vtk.org/u/amaclean)
#### Post date: [March 6, 2022, 4:39am UTC](https://discourse.vtk.org/t/how-to-set-the-cameras-orientation-back-to-0-0-0/7984/2 "2022-03-06T04:39:44Z")

</div>

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 [ResetCameraOrientation.py](https://discourse.vtk.org/uploads/short-url/snLhRoKggXut1ABjTRS3sw7qmEU.py) (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.

---

<div class="post-metadata">

### Author: ![amaclean](https://discourse.vtk.org/user_avatar/discourse.vtk.org/amaclean/32/224_2.png) [@amaclean](https://discourse.vtk.org/u/amaclean)
#### Post date: [March 8, 2022, 5:22am UTC](https://discourse.vtk.org/t/how-to-set-the-cameras-orientation-back-to-0-0-0/7984/3 "2022-03-08T05:22:05Z")

</div>

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

- Python: [ResetCameraOrientation](https://kitware.github.io/vtk-examples/site/Python/Utilities/ResetCameraOrientation/)
- C++: [ResetCameraOrientation](https://kitware.github.io/vtk-examples/site/Cxx/Utilities/ResetCameraOrientation/)

Thanks

---

<div class="post-metadata">

### Author: ![AlexLuya](https://discourse.vtk.org/user_avatar/discourse.vtk.org/alexluya/32/4036_2.png) [@AlexLuya](https://discourse.vtk.org/u/AlexLuya)
#### Post date: [March 9, 2022, 8:49am UTC](https://discourse.vtk.org/t/how-to-set-the-cameras-orientation-back-to-0-0-0/7984/4 "2022-03-09T08:49:14Z")

</div>

Thanks very much
