6
votes
How to express and verify euler rotation limits in Unity
Euler angles aren't necessarily a good way of expressing limits over arbitrary ranges, as their behaviour close to zero is very different from their behaviour away from zero.
Below I've visualized ...
6
votes
Accepted
Euler angle and Quaternion conversion become weird when yaw is bigger than 90 degrees
Your current code assumes it's always going to get Euler angles where x is between ±90° and z is close to 0.
Meanwhile, glm wants to return Euler angles that are standardized so that y is between ±90°,...
4
votes
GLM conversion from euler angles to quaternion and back does not hold
The results are not what you expect, but they are not wrong. It’s just that for a given orientation there are at least two “paths” through Euler angles that lead there.
For instance, the identity ...
3
votes
Order of rotation in Euler angles
Order does matter. For fps games it should generally be yaw -> pitch -> roll. When using matrices, note that multiplication order might be the complete opposite.
Think about it, doing the pitch first ...
2
votes
Accepted
Why does the pitch affect the x component of the front vector?
"Why does pitch affect the x component?"
Short answer: because you could be looking left or right.
Now, you may say if yaw is zero (or ±π), then ...
2
votes
Accepted
How to check whether an angle lies within a specific negative to positive range?
Doing math on Euler angles can get you into trouble.
Under the hood, Unity uses quaternions to have simpler & more uniform rotational behaviour. It converts to Euler angles when it needs to ...
2
votes
Accepted
How to clamp rotation on a specific axis?
It's generally not safe to use Euler angles as the input to a computation. Many different Euler angle representations map to the same resulting orientation, and the values need to wrap around ...
2
votes
Accepted
Using Euler angles to rotate object 360 degrees
Final code is easier than the one I posted. I just didn't think about doing it this way.
...
1
vote
Convert 3D direction vectors to yaw/pitch/roll angles
This is related to the problem of converting from Cartesian Coordinates to Spherical Coordinates. Note that the reverse operation is not unique: there are many possible angle triplets that produce the ...
1
vote
Accepted
Get object rotation around the x axis
Remember, Euler angles are a fiction, made for ease of data input in the scene editor. They're not stored under the hood, so when you read an Euler angle triplet, it's converted on the fly from the ...
1
vote
Accepted
NVidia Physx get yaw pitch roll from rigid body orientation
The solution was found here
And here is the code :
...
1
vote
Accepted
Character rotation jitters when looking around
This line extracts just 2 imaginary components out of a 4-dimensional quaternion:
...
1
vote
Euler Angles of Any Great Circle from hit.point of a sphere
I'm going to assume you're using Unity's coordinate system and Euler angle conventions. I'm also going to assume you have a "reference" great circle model as a child of the sphere, which in ...
1
vote
Accepted
360 degree Shooting using Pythagoras problem Unity 2D C#
transform.rotation is a Quaternion, not a collection of angles. Accessing individual components of a quaternion is almost never ...
1
vote
How can I use a redundant axis of rotation to prevent gimbal-lock & calculate a position for that axis?
My first thought is that we could solve this by gradient descent.
Assuming we did a good job aligning our pointer to the target & minimizing gimbal lock last frame, then this frame we should be ...
1
vote
How to express and verify euler rotation limits in Unity
Maintain your own layer that operates on euler angles, and keeps current values of these stored every frame. Unity derives the quaternion form for the purposes of allowing the renderer and physics to ...
1
vote
Why does the pitch affect the x component of the front vector?
Yaw is applied first, then pitch, you can see this on the following gif (I first rotate the pitch, then I do the same but I change the yaw too):
1
vote
How is a gimbal connected with Euler rotation angles?
The issue not because Euler angles can't represent all orientations (they can) but because they don't interpolate between two orientations cleanly. The analogy with the physical gimbal lock isn't 100% ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
euler-angles × 35rotation × 21
quaternion × 19
unity × 11
opengl × 6
3d × 5
glm × 5
gimbal-lock × 5
c# × 4
c++ × 3
mathematics × 3
animation × 2
camera × 2
geometry × 2
transformation × 2
skeletal-animation × 2
angles × 2
2d × 1
physics × 1
vector × 1
matrix × 1
voxels × 1
unityscript × 1
linear-algebra × 1
godot-4 × 1