# Using gyroscope data without rotation around z axis

**URL:** <https://discourse.threejs.org/t/using-gyroscope-data-without-rotation-around-z-axis/24262>\
**Category:** Questions\
**Tags:** device-orientation\
**Created:** [March 10, 2021, 10:15pm UTC](https://discourse.threejs.org/t/using-gyroscope-data-without-rotation-around-z-axis/24262 "2021-03-10T22:15:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vans](https://avatars.discourse-cdn.com/v4/letter/v/4da419/32.png) [@Vans](https://discourse.threejs.org/u/Vans)\
**Post date:** [March 10, 2021, 10:15pm UTC](https://discourse.threejs.org/t/using-gyroscope-data-without-rotation-around-z-axis/24262/1 "2021-03-10T22:15:10Z")

</div>

Hello everyone,

I wanted to know if it is possible to use gyroscope data in such a way that there is no rotation on the z-axis i.e lock z axis for rotation. i tried making the roll value zero but it doesn’t work

I would be grateful if someone can please help me with this.

Thanks,  
Vans

---

<div class="post-metadata">

**Author:** ![mjurczyk](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mjurczyk/32/10995_2.png) [@mjurczyk](https://discourse.threejs.org/u/mjurczyk)\
**Post date:** [March 12, 2021, 1:00pm UTC](https://discourse.threejs.org/t/using-gyroscope-data-without-rotation-around-z-axis/24262/2 "2021-03-12T13:00:45Z")

</div>

Yes, it should be possible.

You don’t necessarily have to modify the gyroscope data itself (since it’s read from hardware it’s likely read-only.) To ignore any axis in 3D, you can just modify [Camera.rotation](https://threejs.org/docs/#api/en/core/Object3D.rotation).

---

<div class="post-metadata">

**Author:** ![Vans](https://avatars.discourse-cdn.com/v4/letter/v/4da419/32.png) [@Vans](https://discourse.threejs.org/u/Vans)\
**Post date:** [March 14, 2021, 10:44pm UTC](https://discourse.threejs.org/t/using-gyroscope-data-without-rotation-around-z-axis/24262/3 "2021-03-14T22:44:54Z")

</div>

I tried setting the camera.rotation for trhe z axis to zero and the camera rotation is weird ☹
