ext_matrix_transform Module Reference
Defines functions that generate common transformation matrices.
The matrices generated by this extension use standard OpenGL fixed-function conventions. For example, the lookAt function generates a transform from world space into the specific eye space that the projective matrix functions (perspective, ortho, etc) are designed to expect. The OpenGL compatibility specifications defines the particular layout of this eye space.
Include < glm/ext/matrix_transform.hpp > to use the features of this extension.
Public Member Functions
-
GLM_FUNC_DECL GLM_CONSTEXPR genTypeidentity ()
Builds an identity matrix.
-
GLM_FUNC_DECL mat< 4, 4, T, Q >translate (mat< 4, 4, T, Q > const &m, vec< 3, T, Q > const &v)
Builds a translation 4 * 4 matrix created from a vector of 3 components.
m
Input matrix multiplied by this translation matrix.
vCoordinates of a translation vector.
TA floating-point scalar type
QA value from qualifier enum
#include <glm/glm.hpp> #include <glm/gtc/matrix_transform.hpp> ... glm::mat4 m = glm::translate(glm::mat4(1.0f), glm::vec3(1.0f)); // m[0][0] == 1.0f, m[0][1] == 0.0f, m[0][2] == 0.0f, m[0][3] == 0.0f // m[1][0] == 0.0f, m[1][1] == 1.0f, m[1][2] == 0.0f, m[1][3] == 0.0f // m[2][0] == 0.0f, m[2][1] == 0.0f, m[2][2] == 1.0f, m[2][3] == 0.0f // m[3][0] == 1.0f, m[3][1] == 1.0f, m[3][2] == 1.0f, m[3][3] == 1.0f
- See Also
- translate(mat<4, 4, T, Q> const& m, T x, T y, T z)
- See Also
- See Also
-
GLM_FUNC_DECL mat< 4, 4, T, Q >rotate (mat< 4, 4, T, Q > const &m, T angle, vec< 3, T, Q > const &axis)
Builds a rotation 4 * 4 matrix created from an axis vector and an angle.
m
Input matrix multiplied by this rotation matrix.
angleRotation angle expressed in radians.
axisRotation axis, recommended to be normalized.
TA floating-point scalar type
QA value from qualifier enum
- See Also
- rotate(mat<4, 4, T, Q> const& m, T angle, T x, T y, T z)
- See Also
- See Also
-
GLM_FUNC_DECL mat< 4, 4, T, Q >scale (mat< 4, 4, T, Q > const &m, vec< 3, T, Q > const &v)
Builds a scale 4 * 4 matrix created from 3 scalars.
m
Input matrix multiplied by this scale matrix.
vRatio of scaling for each axis.
TA floating-point scalar type
QA value from qualifier enum
- See Also
- scale(mat<4, 4, T, Q> const& m, T x, T y, T z)
- See Also
- See Also
-
GLM_FUNC_DECL mat< 4, 4, T, Q >lookAtRH (vec< 3, T, Q > const &eye, vec< 3, T, Q > const ¢er, vec< 3, T, Q > const &up)
Build a right handed look at view matrix.
eye
Position of the camera
centerPosition where the camera is looking at
upNormalized up vector, how the camera is oriented. Typically (0, 0, 1)
TA floating-point scalar type
QA value from qualifier enum
- See Also
- frustum(T const& left, T const& right, T const& bottom, T const& top, T const& nearVal, T const& farVal) frustum(T const& left, T const& right, T const& bottom, T const& top, T const& nearVal, T const& farVal)
-
GLM_FUNC_DECL mat< 4, 4, T, Q >lookAtLH (vec< 3, T, Q > const &eye, vec< 3, T, Q > const ¢er, vec< 3, T, Q > const &up)
Build a left handed look at view matrix.
eye
Position of the camera
centerPosition where the camera is looking at
upNormalized up vector, how the camera is oriented. Typically (0, 0, 1)
TA floating-point scalar type
QA value from qualifier enum
- See Also
- frustum(T const& left, T const& right, T const& bottom, T const& top, T const& nearVal, T const& farVal) frustum(T const& left, T const& right, T const& bottom, T const& top, T const& nearVal, T const& farVal)
-
GLM_FUNC_DECL mat< 4, 4, T, Q >lookAt (vec< 3, T, Q > const &eye, vec< 3, T, Q > const ¢er, vec< 3, T, Q > const &up)
Build a look at view matrix based on the default handedness.
eye
Position of the camera
centerPosition where the camera is looking at
upNormalized up vector, how the camera is oriented. Typically (0, 0, 1)
TA floating-point scalar type
QA value from qualifier enum
- See Also
- frustum(T const& left, T const& right, T const& bottom, T const& top, T const& nearVal, T const& farVal) frustum(T const& left, T const& right, T const& bottom, T const& top, T const& nearVal, T const& farVal)
- See Also