# [Solved]Get Euler Angles From Rotation.

## Recommended Posts

currently node.GetRotation() returns the rotation in type quat, i want to make changes to the rotation is there any way i can get the rotation in euler angles like Quaternion.Euler from unity?

Dear @WarDuck,

For your case you use the following.

```mat3 mat3Rotation = m_quatRotation.getMat3();
vec3 vec3RotationEulerAngles = decomposeRotationXYZ(mat3Rotation);```

Hope this helps.

Should Also work in C#.

Rohit

Edited by rohit.gonsalves
• 1

Thank you its exactly what i was looking for, but I am not getting the desired result.

```		mat3 currentRotation = node.GetRotation().Mat3;
vec3 eulerAngles = MathLib.DecomposeRotationXYZ(currentRotation);
Log.MessageLine(eulerAngles);```

This is my Function I am just printing out the current rotation like the one we see in the editor Parameters window.

Dear

For angles you start from 0. Go clock wise 300 degrees. And then start from 0 and go anti clockwise 60 degrees (-60). Though the magnitude are different. Directions make the point same. You will end up at same point. This is perfect. Probably the function after decomposing the Euler angles returns in range of -180 to 180 or -360 to 360. Remap to range 0 to 360.

if angle < 0

360 + angle

Again. If editor shows -90 and the result is 270. Both are same.

Rohit

• 1