<p>How do we rotate the camera around <code>x axis</code> 360 degrees, without having to flip the axis, meaning without having the strange flip after we go over +-90 degrees on <code>x axis</code>.
Mine behaves exactly the same way spherical coordinates would, I'm using euler angles.</p>

<p>Tried googling, but couldn't find a proper answer, guessing I don't know what exactly to google for, googled 'rotate 360 around x axis', got no proper answers.</p>

<p><strong>References</strong></p>

<p>C++ code: </p>

<p><a href="https://pastebin.com/BBGdmKGb" rel="nofollow noreferrer">https://pastebin.com/BBGdmKGb</a></p>

<p>Video:</p>

<p><a href="https://drive.google.com/open?id=0Bz3F9j1LiPNTS29XSUJoU2taRXc" rel="nofollow noreferrer">https://drive.google.com/open?id=0Bz3F9j1LiPNTS29XSUJoU2taRXc</a></p>

CC BY-SA 3.0
2017-10-14T01:18:31.690Z
I think I know what flip you're talking about. Most people just clamp it and stop the camera. You want your camera to be upside down after going over +-90 degrees? If not then there'd have to be a twist to the camera. Like once one of your spherical angles hits +-90 degrees the other angle does a 180.
Andrew Wilson
CC BY-SA 3.0
2017-10-14T15:39:04.530Z
The OP is having a different problem. Their code protects the pitch from getting to high or low, but they are having problems with yaw rotation.
Alan Wolfe
CC BY-SA 3.0
2017-10-14T16:19:06.053Z
@AlanWolfe I've just uploaded a video of explaining the issue.

I think the yaw(rotation around y axis) works, but pitch(around x) doesn't, if I'm not mistaking.
Test
CC BY-SA 3.0
2017-10-14T16:25:12.277Z
@AlanWolfe Also, sorry I think I've uploaded the wrong code on the original post, just updated it. I'm simply trying to rotate the camera around the center. Around y axis works, but around x it acts strange, and I think it's because the rotation on x axis is limited to 180 degrees and if we go over it, it probably has to rotate the y axis first and then x to achieve the desired rotation point?
Test
<opengl><c++><glm><linear-algebra>
360 degrees rotation around x axis
Test
# 360 degrees rotation around x axis

(Asked by: username_0 on 2017-10-13)

How do we rotate the camera around `x axis` 360 degrees, without having to flip the axis, meaning without having the strange flip after we go over +-90 degrees on `x axis`.
Mine behaves exactly the same way spherical coordinates would, I'm using euler angles.

Tried googling, but couldn't find a proper answer, guessing I don't know what exactly to google for, googled 'rotate 360 around x axis', got no proper answers.

**References**

C++ code:

<https://pastebin.com/BBGdmKGb>

Video:

<https://drive.google.com/open?id=0Bz3F9j1LiPNTS29XSUJoU2taRXc>

**Tags:** opengl, c++, glm, linear-algebra

> **Comments:**
> **username_1**: I think I know what flip you're talking about. Most people just clamp it and stop the camera. You want your camera to be upside down after going over +-90 degrees? If not then there'd have to be a twist to the camera. Like once one of your spherical angles hits +-90 degrees the other angle does a 180.  
> **username_2**: The OP is having a different problem. Their code protects the pitch from getting to high or low, but they are having problems with yaw rotation.  
> **username_0**: @username_2 I've just uploaded a video of explaining the issue.  I think the yaw(rotation around y axis) works, but pitch(around x) doesn't, if I'm not mistaking.  
> **username_0**: @username_2 Also, sorry I think I've uploaded the wrong code on the original post, just updated it. I'm simply trying to rotate the camera around the center. Around y axis works, but around x it acts strange, and I think it's because the rotation on x axis is limited to 180 degrees and if we go over it, it probably has to rotate the y axis first and then x to achieve the desired rotation point?  

---

## 0 answers

