PDA

View Full Version : GLM: matrix from translation, rotation and scale?



Vexator
07-12-2010, 01:32 PM
hi!
i'd like to create a mat4 from a translation vector, a quaternion and a scalar/vector representing scale. there is transform() to manipulate the translation part of a matrix but rotate() only accepts an axis and a rotation vector and not a quaternion to manipulate the orientation part of a matrix.

a constructor accepting all three (or at least translation vector and quaternion) would be nice. also, how can i create a matrix from a quaternion?

thank you!

Groovounet
07-13-2010, 04:11 AM
I think that what you are looking for is quat_cast and mat4_cast.

This is part of GLM_GTC_quaternion. A constructor in matrix types taking a quatertion is unlikely to happen as in would imply adding "extensions" features inside "core" features which is against GLM convension: following as much as possible GLSL.

This is actually a really important idea to keep it easy to use.