# Some question about camera rotation with quaternion

**URL:** <https://discourse.threejs.org/t/some-question-about-camera-rotation-with-quaternion/49444>\
**Category:** Questions\
**Tags:** rotation, quaternion, threejs\
**Created:** [March 22, 2023, 2:15pm UTC](https://discourse.threejs.org/t/some-question-about-camera-rotation-with-quaternion/49444 "2023-03-22T14:15:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lua\_Ga\_Chi\_n\_Th\_n](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/lua_ga_chi_n_th_n/32/34668_2.png) [@Lua\_Ga\_Chi\_n\_Th\_n](https://discourse.threejs.org/u/Lua_Ga_Chi_n_Th_n)\
**Post date:** [March 22, 2023, 2:15pm UTC](https://discourse.threejs.org/t/some-question-about-camera-rotation-with-quaternion/49444/1 "2023-03-22T14:15:41Z")

</div>

I used euler rotation to interact with the phone screen this.euler.x and this.euler.y are two coefficients. when you touch and move your finger on the screen this.euler.x and this.euler.y will change, thereby allowing the camera to change the angle like the video below

 ![IMG_20230322_205651](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/4/7/47c3943e3a47322307932bf489866ab663e13f7a.jpeg)  
And video  

[https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/7/8/785d64090c1cb66d4ae68914593bae1ac3e60762.mp4](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/7/8/785d64090c1cb66d4ae68914593bae1ac3e60762.mp4)
  
///  
but when i use quaternion rotation with this.v.x and this.v.y same with this.euler.x and this.euler.y it get error like below video. please help me, i really don’t understand the quaternion rotation. But due to some gimbal locking problem with euler rotation, I have to switch to quaternion rotation  
My code :

---

<div class="post-metadata">

**Author:** ![Lua\_Ga\_Chi\_n\_Th\_n](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/lua_ga_chi_n_th_n/32/34668_2.png) [@Lua\_Ga\_Chi\_n\_Th\_n](https://discourse.threejs.org/u/Lua_Ga_Chi_n_Th_n)\
**Post date:** [March 23, 2023, 10:42am UTC](https://discourse.threejs.org/t/some-question-about-camera-rotation-with-quaternion/49444/3 "2023-03-23T10:42:49Z")

</div>

My code and video

[https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/6/c/6c69777c07579286f28ca84bcf532fdd3b5f35f9.mp4](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/6/c/6c69777c07579286f28ca84bcf532fdd3b5f35f9.mp4)
  
Code  
 ![IMG_20230322_205717](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/8/9/899f9c2602309d3b0894238ebd77eddce36396df.jpeg)
