# Make OrbitControls turn camera exact 180 degress from its current position/rotation

**URL:** <https://discourse.threejs.org/t/make-orbitcontrols-turn-camera-exact-180-degress-from-its-current-position-rotation/34625>\
**Category:** Questions\
**Tags:** orbit-controls\
**Created:** [February 8, 2022, 12:56pm UTC](https://discourse.threejs.org/t/make-orbitcontrols-turn-camera-exact-180-degress-from-its-current-position-rotation/34625 "2022-02-08T12:56:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![blackInk](https://avatars.discourse-cdn.com/v4/letter/b/c2a13f/32.png) [@blackInk](https://discourse.threejs.org/u/blackInk)\
**Post date:** [February 8, 2022, 12:56pm UTC](https://discourse.threejs.org/t/make-orbitcontrols-turn-camera-exact-180-degress-from-its-current-position-rotation/34625/1 "2022-02-08T12:56:20Z")

</div>

Can I tell OrbitControls to rotate the camera (rotationY) exactly 180° from its current rotation.y?

Any help is highly appreciated  
b

---

<div class="post-metadata">

**Author:** ![drcmda](https://avatars.discourse-cdn.com/v4/letter/d/91b2a8/32.png) [@drcmda](https://discourse.threejs.org/u/drcmda)\
**Post date:** [February 8, 2022, 1:24pm UTC](https://discourse.threejs.org/t/make-orbitcontrols-turn-camera-exact-180-degress-from-its-current-position-rotation/34625/2 "2022-02-08T13:24:11Z")

</div>

you can’t. [this has been a request for many years](https://github.com/mrdoob/three.js/pull/9005). though you may want to exchange three/examples/jsm with this: [https://github.com/pmndrs/three-stdlib](https://github.com/pmndrs/three-stdlib)

the difference is that stdlib is a little more liberal when it comes to accepting prs.

```javascript
controls.setAzimuthalAngle(azimuth)
controls.setPolarAngle(polar)

```

> **[Controlling OrbitControls - CodeSandbox](https://codesandbox.io/s/controlling-orbitcontrols-xoyup)**
>
> Controlling OrbitControls by code, making it circle its center along the azimuth and polar.

---

<div class="post-metadata">

**Author:** ![vielzutun.ch](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/vielzutun.ch/32/21366_2.png) [@vielzutun.ch](https://discourse.threejs.org/u/vielzutun.ch)\
**Post date:** [February 8, 2022, 2:42pm UTC](https://discourse.threejs.org/t/make-orbitcontrols-turn-camera-exact-180-degress-from-its-current-position-rotation/34625/3 "2022-02-08T14:42:36Z")

</div>

Just for my understanding: do you want to have the camera _ **look away** _ from the target?

If that’s the case, you might(!!) possibly achieve the same effect (that is: **HACK** OrbitControls without any code change) by providing a “fake” target which would have to be re-computed on every new frame though.

[Food for thought](https://discourse.threejs.org/t/how-can-a-light-source-be-fixed-behind-an-object-but-with-camera-movement/33978/3).

Please report back.

---

<div class="post-metadata">

**Author:** ![blackInk](https://avatars.discourse-cdn.com/v4/letter/b/c2a13f/32.png) [@blackInk](https://discourse.threejs.org/u/blackInk)\
**Post date:** [February 8, 2022, 3:17pm UTC](https://discourse.threejs.org/t/make-orbitcontrols-turn-camera-exact-180-degress-from-its-current-position-rotation/34625/4 "2022-02-08T15:17:27Z")

</div>

Thanks for all your feedback - meanwhile I solved it that way that I expanded origin OrbitControls with a little extra-function that I can fire from my main-class then…

```javascript
function setTheta( radians ) {
sphericalDelta.theta -= radians;
}

```

---

<div class="post-metadata">

**Author:** ![rrrr\_rrrr](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/rrrr_rrrr/32/7697_2.png) [@rrrr\_rrrr](https://discourse.threejs.org/u/rrrr_rrrr)\
**Post date:** [February 8, 2022, 8:50pm UTC](https://discourse.threejs.org/t/make-orbitcontrols-turn-camera-exact-180-degress-from-its-current-position-rotation/34625/5 "2022-02-08T20:50:52Z")

</div>

> [@blackInk](#):
>
> I solved it that way that I expanded origin OrbitControls with a little extra-function that I can fire from my main-class then…

One way is a dirty hack hard-coding:

```plaintext
this.rotate = function( x = 1, q ) { 
x = Math.PI*x/180; 
if( q ) rotateLeft(x); 
else rotateUp(x); 
this.update(); 
};

```

Exposing private methods or you can simply do this:

```plaintext
camera.position.applyQuaternion(
(new THREE.Quaternion).setFromAxisAngle(new THREE.Vector3( 0, 1, 0 ), Math.PI)); 
controls.update();

```
