# Regarding Playground Example re-set rotationQuaternion

**URL:** <https://forum.babylonjs.com/t/regarding-playground-example-re-set-rotationquaternion/2997>\
**Category:** Questions\
**Tags:** documentation\
**Created:** [May 6, 2019, 12:44am UTC](https://forum.babylonjs.com/t/regarding-playground-example-re-set-rotationquaternion/2997 "2019-05-06T00:44:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jjkavalam](https://avatars.discourse-cdn.com/v4/letter/j/6bbea6/32.png) [@jjkavalam](https://forum.babylonjs.com/u/jjkavalam)\
**Post date:** [May 6, 2019, 12:44am UTC](https://forum.babylonjs.com/t/regarding-playground-example-re-set-rotationquaternion/2997/1 "2019-05-06T00:44:53Z")

</div>

Hi am new to the world of 3D graphics as well as to Babylon.js.

I read in:  
[https://doc.babylonjs.com/resources/rotation\_conventions](https://doc.babylonjs.com/resources/rotation_conventions)

the following:

> You cannot use both a rotation and a rotationQuaternion on a mesh. When a rotationQuaternion is applied to a mesh this overwrites the current and subsequent use of rotation producing the wrong orientation. Should you want to use rotation after a rotationQuaternion has been applied, for example on an imported mesh, then the rotationQuaternion has to be set to null.  
> To see this effect comment out line 48 in the following playground
> 
> Playground Example re-set rotationQuaternion ([https://www.babylonjs-playground.com/#1ST43U#77](https://www.babylonjs-playground.com/#1ST43U#77))

In my understanding by commenting out line 48 (which set the rotationQuaternion to null) it is expected that the two boxes will not be aligned anymore. But the example doesn’t seem to do that.

Something seems amiss with my understanding / the example ?

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [May 6, 2019, 12:57am UTC](https://forum.babylonjs.com/t/regarding-playground-example-re-set-rotationquaternion/2997/2 "2019-05-06T00:57:23Z")

</div>

Actually something is missing in the doc.  
For convenience and because we faced a lot of questions regarding that problem we allo you to still change the value of rotation even if rotationQuaternion is set.

In this case the system will ADD that rotation to the rotationQuaternion and then set it back to zero (the mesh.rotation will be (0, 0, 0))

Pinging @JohnK FYI

---

<div class="post-metadata">

**Author:** ![JohnK](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/johnk/32/26764_2.png) [@JohnK](https://forum.babylonjs.com/u/JohnK)\
**Post date:** [May 6, 2019, 9:11am UTC](https://forum.babylonjs.com/t/regarding-playground-example-re-set-rotationquaternion/2997/3 "2019-05-06T09:11:27Z")

</div>

> [@Deltakosh](#):
>
> In this case the system will ADD that rotation to the rotationQuaternion and then set it back to zero (the mesh.rotation will be (0, 0, 0))

Unfortunately I do not think this is correct.

In [https://www.babylonjs-playground.com/#1ST43U#185](https://www.babylonjs-playground.com/#1ST43U#185) I am not seeing this description of events in the console

```auto
rotationQuaterion is set { x: 0.10503269547928776, y: 0.001336730075941206, z: 0.7669894582804743, w: 0.6330035678569939 }
and so rotation is { x: 0, y: 0, z: 0 }

Following this the rotation is set { x: 0.1312985505528809, y: 0.16497104582455158, z: 1.7724948616328908 }
and rotationQuaternion is null

```

So I think the pattern is  
set rotationQuaternion to Q and rotationQuaternion is Q and rotation is zero

Even when rotationQuaternion has been set then setting rotation to R rotation is R and rotationQuaternion is null.

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [May 6, 2019, 2:51pm UTC](https://forum.babylonjs.com/t/regarding-playground-example-re-set-rotationquaternion/2997/4 "2019-05-06T14:51:26Z")

</div>

OMG! I feel so stupid!

What I described was BEFORE 4.0. Now to make things simpler, we just turn off automatically rotationQuaternion to null if you set the rotation property

Thanks @JohnK! I stand corrected 😃

---

<div class="post-metadata">

**Author:** ![BeginnerGamer](https://avatars.discourse-cdn.com/v4/letter/b/c89c15/32.png) [@BeginnerGamer](https://forum.babylonjs.com/u/BeginnerGamer)\
**Post date:** [July 15, 2019, 11:28am UTC](https://forum.babylonjs.com/t/regarding-playground-example-re-set-rotationquaternion/2997/5 "2019-07-15T11:28:10Z")

</div>

Hello,

I am having the same problem. I am rotating objects with rotation gizmo but when i try to get rotation values of the meshes, it returns “0”. I tried to apply your solutions, set rotationquaternion to null, still couldnot manage. Could you help me understand the problem?

[https://playground.babylonjs.com/#SEIT79#27](https://playground.babylonjs.com/#SEIT79#27)

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [July 15, 2019, 5:02pm UTC](https://forum.babylonjs.com/t/regarding-playground-example-re-set-rotationquaternion/2997/6 "2019-07-15T17:02:29Z")

</div>

The rotation gizmo will reset the rotation quaternion as it works on quaternion only so you need to use `mesh.rotationQuaternion.toEulerAngles()` to get the rotation
