From tests of quaternions in OpenGL I noticed that rotations on multiple axis are not working how they should. So I wrote a simple program to debug that. This is my program:
glm::quat rotation = glm::angleAxis(glm::radians(45.0f), glm::vec3(1.0f, 1.0f, 0.0f));
glm::vec3 eulerRotation = glm::degrees(glm::eulerAngles(rotation));
printf("X = %f\tY = %f\tZ = %f\n", eulerRotation.x, eulerRotation.y, eulerRotation.z);
From my understanding of rotations this should output:
X = 45.0 Y = 45.0 Z = 0.0
But the program outputs this:
X = 51.589348 Y = 45.000004 Z = 18.939444
I'm using GLM version 0.9.9.5 and C++ 14 So, is my understanding of rotations wrong or is GLM screwing something up?