I am trying to allocate my model a position in scene according to the 9DoF parameters. Out of which, the rotations are giving me a hard time. If I am keeping x and z rotations zero then the roty seems to work fine and model revolve around y axis only. But as soon as I am giving x and y rotations any value, then model moves around other two axis while doing y rotation.
Below is the code I am using to give the rotx, roty, rotz values. I feel like there is some problem with matrix multiplication. Because 0 * x + roty * y + 0 * z = roty only but anything * x + roty * y + anything * z = anything.
model = glm::translate(model, glm::vec3(transX, transY, transZ));
model = glm::rotate(model, toRadians * rotX, glm::vec3(1, 0, 0));
model = glm::rotate(model, toRadians * rotY, glm::vec3(0, 1, 0));
model = glm::rotate(model, toRadians * rotZ, glm::vec3(0, 0, 1));