# Invert Z axis of camera.getWorldDirection

**URL:** <https://discourse.threejs.org/t/invert-z-axis-of-camera-getworlddirection/45221>\
**Category:** Questions\
**Created:** [November 27, 2022, 4:07pm UTC](https://discourse.threejs.org/t/invert-z-axis-of-camera-getworlddirection/45221 "2022-11-27T16:07:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ItzArty](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/itzarty/32/14952_2.png) [@ItzArty](https://discourse.threejs.org/u/ItzArty)\
**Post date:** [November 27, 2022, 4:07pm UTC](https://discourse.threejs.org/t/invert-z-axis-of-camera-getworlddirection/45221/1 "2022-11-27T16:07:20Z")

</div>

Hello, Im not certain how to correctly express my problem here, but basically Im using getWorldDirection and invert the Z axis with `direction.z *= -1`, however this does not work properly when moving outside 0, 0, 0, since when I turn to the right by 90deg for example, now Im inverting something completely else as its a THREE.Vector3() and not a real direction. I tried using `.applyAxisAngle( new THREE.Vector3( 1, 0, 0 ), Math.PI )` but that yielded the same result as just inverting the Z axis. When I copy the direction with a -1, 0, 0 Vector3 it does nothing. I really dont want to do calculations based on the coordinates as I think there surely is a better way to go about it.

---

<div class="post-metadata">

**Author:** ![tfoller](https://avatars.discourse-cdn.com/v4/letter/t/3e96dc/32.png) [@tfoller](https://discourse.threejs.org/u/tfoller)\
**Post date:** [November 28, 2022, 3:04am UTC](https://discourse.threejs.org/t/invert-z-axis-of-camera-getworlddirection/45221/2 "2022-11-28T03:04:12Z")

</div>

Camera forward vector can be calculated like so:

```javascript
const forward = new THREE.Vector3(0.0, 0.0, -1.0).applyQuaternion(camera.quaternion);

```

then you can negate this vector:

```javascript
const backward = forward.negate();

```
