Questions tagged [euler-angles]

The Euler angles are three angles introduced by Leonhard Euler to describe the 3D orientation of a rigid body.

The idea of Euler angles is to split the complete rotation of a cartesian coordinate system into three simpler rotations about the axes of this system. Euler angles also represent three composed rotations that move a reference frame to a given referred frame. This is equivalent to saying that any orientation can be achieved by composing three elemental rotations (rotations around a single axis), and also equivalent to saying that any rotation matrix can be decomposed as a product of three elemental rotation matrices.

475 questions
4
votes
2 answers

Euler Angles and Rotation Matrix from two 3D points

I am trying to find the Euler angles that allow the transformation from point A to point B in 3D space. Consider the normalized vectors A = [1, 0, 0] and B = [0.32 0.88 -0.34]. I understand that by computing the cross product A × B I get the…
jcampos
  • 67
  • 2
  • 7
4
votes
1 answer

Gimbal Lock how does it happen?

So I searched on the net and I'm having some problems imagining how the gimbal-lock occurs. According to what i saw, it occurs when 2 or more axes align losing a degree of freedom but I can't imagine how will the axes even begin to align? I mean,…
gallickgunner
  • 472
  • 5
  • 20
4
votes
1 answer

How to avoid Gimbal lock when converting from Quaternion to Roll Pitch Yaw

I have a IMU sensor that gives me orientation in terms of Quaternion and I would like to change it to readable RPY angles. I found the formula to convert them intrinsically from Wiki for a quaternion q=…
user3763570
  • 157
  • 1
  • 9
4
votes
2 answers

Unity3d - eulerAngles (local and global) totally different than what's in inspector

In the inspector for a gameObject I'm using the starting rotation is "-90", but when I run print(transform.eulerAngles.x) I get 270 (ditto for transform.localEulerAngles.x). If I tilt the gameObject downward, the inspector X value gets bigger (say,…
papathor
  • 49
  • 1
  • 2
4
votes
0 answers

Directional Vector to Euler/Otherwise

I know this question has been asked alot, but I haven't seen any answers that satisfy my needs. My problem rests in the fact i've gotten very used to developing in an env where converting a vector to a euler angle set was simple Vec.ToAngle, and now…
ZZT
  • 71
  • 1
  • 6
4
votes
2 answers

Rotate a quaternion by Euler angles input

I am writing a code to control robotic arm in 3D space. The robotic arm handle the rotation by quaternion but I want user to control it by changing yaw, pitch and roll since its more sensible for human to use these. I wrote function to get the…
D3GAN
  • 642
  • 10
  • 26
4
votes
2 answers

How to calculate Euler angles from Forward, Up and Right vectors?

Because this is a complex question that usually results in much confusion (I've asked variations on this question previously, but never asked the question the right way and never got an answer), I'm going to try to make this as clear as…
Clonkex
  • 3,373
  • 7
  • 38
  • 55
4
votes
1 answer

Inverting 3d rotation sequence

I have a transformation matrix constructed as H = Rz * Ry * Rx. So rotations are performed in xyz order. Now, given rotation angles around x, y, and z axes, is there a way to find rotation angles to perform inverse operation, such that v = Rz * Ry…
Blaz Bratanic
  • 2,279
  • 12
  • 17
4
votes
1 answer

What I came up with by trial and error works, could you explain why?

First of all, I wasn't sure if this question is welcome here and I checked the FAQ and found out that "I would like others to explain" questions are. The main issue is that I need to store rotations of all objects twice in my application. That is…
danijar
  • 32,406
  • 45
  • 166
  • 297
4
votes
4 answers

Conversion between Euler <=> Quaternion like in Unity3d engine

I've used two examples (from this site too), but results are not the same as those that said Unity. Quaternion.Euler and .eulerAngles are Unity functions. FromQ doesn't perform singularity check, FromQ2 does. Results: eulers =…
Vlad
  • 3,001
  • 1
  • 22
  • 52
4
votes
1 answer

Find x,y,z rotation between two normal vectors

I have two squares in 3D space. I want to find the x,y,z angles between them. I started by finding the normal vectors for both of the squares and I am trying to figure out how to get the angle between them. I am using XNA (C#) Vector3 objects. I…
Jkh2
  • 1,010
  • 1
  • 13
  • 25
3
votes
7 answers

Rotation in Unity3D

This is a simplified code from what I'm trying to do: var angle = 1.57; if ( this.transform.rotation.y > angle ){ this.transform.rotation.y--; } else if ( this.transform.rotation.y < angle ){ this.transform.rotation.y++; } I'm used to code in…
William
  • 61
  • 1
  • 1
  • 5
3
votes
1 answer

Getting Euler Angles from a Quaternion in Matlab

I have the X,Y,Z and W components of a Quaternion through time, in 4 separated vectors. QW 1x346 2768 double QX 1x346 2768 double QY 1x346 2768 double QZ …
Jav_Rock
  • 22,059
  • 20
  • 123
  • 164
3
votes
1 answer

Calculating Euler angles from Rotation matrix in C++

I have this code in Python: from scipy.spatial.transform import Rotation r = Rotation.from_matrix(R) angles = r.as_euler("zyx",degrees=True) print(f'angles = {angles}') Where R is 3x3 rotation matrix. And I have this code in C++ which is…
Eugene Alexeev
  • 1,152
  • 12
  • 32
3
votes
1 answer

Calculate rotation to align object with two points in 3D space

I am working with motion capture data and I want to do "skinning" in processing. So basically with every two points I get from my data I have to add a 3D object in between (I'll be using a box for now and the placement and rotation coordinates are…
Brandon H.
  • 33
  • 3