# Absolute rotations depending on axis?

**URL:** <https://forum.babylonjs.com/t/absolute-rotations-depending-on-axis/37036>\
**Category:** Questions\
**Created:** [January 2, 2023, 8:50am UTC](https://forum.babylonjs.com/t/absolute-rotations-depending-on-axis/37036 "2023-01-02T08:50:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Julien1](https://avatars.discourse-cdn.com/v4/letter/j/71c47a/32.png) [@Julien1](https://forum.babylonjs.com/u/Julien1)\
**Post date:** [January 2, 2023, 8:50am UTC](https://forum.babylonjs.com/t/absolute-rotations-depending-on-axis/37036/1 "2023-01-02T08:50:29Z")

</div>

Hi,

Happy new years and wish you the best;

The PG:  
[Rotations](https://playground.babylonjs.com/#WTI2FN)  
Please open a console and look at the third column, which is the absolute rotation of the camera.

My question is: why isn’t it possible to completely tilt the camera on the x axis (doing a like looping), while it is possible on the z axis (full roll).

The X axis will stop and come back in a different orientation (complicating animations scripts) while the Z will continue the loop as usual.

X axis will do  
` [-pi/2; pi/2], => -1.57, -1.56.., 1.56, 1.57, 1.56...`  
while Z will do a continued range [-pi; pi] like so:  
-3.14,…, 0,…, 3.14, -3.14

The looping at X poles is noticeable.  
So:

1. What is the best way to achieve a full,clean, loop on the x axis?
2. will that behaviour be consistent in the future? (I will adapt my scripting around that)

Thanks

---

<div class="post-metadata">

**Author:** ![Julien1](https://avatars.discourse-cdn.com/v4/letter/j/71c47a/32.png) [@Julien1](https://forum.babylonjs.com/u/Julien1)\
**Post date:** [January 2, 2023, 9:36am UTC](https://forum.babylonjs.com/t/absolute-rotations-depending-on-axis/37036/2 "2023-01-02T09:36:17Z")

</div>

Ok,

Issue comes from the up vector, which is axis Y…

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [January 2, 2023, 1:07pm UTC](https://forum.babylonjs.com/t/absolute-rotations-depending-on-axis/37036/3 "2023-01-02T13:07:19Z")

</div>

Hello and happy new years! This is a side effect of using Euler angles to represent rotations, and in this case quaternions would be a better solution: [10 mins GameDev tips - Quaternions - YouTube](https://www.youtube.com/watch?v=1yoFjjJRnLY)

---

<div class="post-metadata">

**Author:** ![Julien1](https://avatars.discourse-cdn.com/v4/letter/j/71c47a/32.png) [@Julien1](https://forum.babylonjs.com/u/Julien1)\
**Post date:** [January 2, 2023, 1:08pm UTC](https://forum.babylonjs.com/t/absolute-rotations-depending-on-axis/37036/4 "2023-01-02T13:08:35Z")

</div>

Did I hit the gimbal lock?
