Why do 3D rotation matrix methods typically use a separate vector and angle instead of regular Euler angles?
For example, in glm
, given a mat4 model
and vec3 rotation
, instead of:
model = glm::rotate (model, rotation);
why do I have to write:
model = glm::rotate (model, rotation.x, glm::vec3 (1, 0, 0));
model = glm::rotate (model, rotation.y, glm::vec3 (0, 1, 0));
model = glm::rotate (model, rotation.z, glm::vec3 (0, 0, 1));
Why do they not simply implement this as a single Euler rotation vector, simplifying pretty much every piece of code to ever use the library? I've seen this in other implementations, too.