# 3D Affine Transforms (post)

Post transform functions are similar to pre transform functions except order of application is reversed. Post transform functions are applied after the object is transformed with given (model matrix) transform.

## Table of contents (click to go):

Functions:

1. `glm_translated_to()`

2. `glm_translated()`

3. `glm_translated_x()`

4. `glm_translated_y()`

5. `glm_translated_z()`

6. `glm_rotated_x()`

7. `glm_rotated_y()`

8. `glm_rotated_z()`

9. `glm_rotated()`

10. `glm_rotated_at()`

11. `glm_spinned()`

## Functions documentation

void glm_translated_to(mat4 m, vec3 v, mat4 dest)

  translate existing transform matrix by v vector and store result in dest

  Parameters:
    [in] m affine transform
    [in] v translate vector [x, y, z]
    [out] dest translated matrix

void glm_translated(mat4 m, vec3 v)

  translate existing transform matrix by v vector and stores result in same matrix

  Parameters:
    [in, out] m affine transform
    [in] v translate vector [x, y, z]

void glm_translated_x(mat4 m, float x)

  translate existing transform matrix by x factor

  Parameters:
    [in, out] m affine transform
    [in] v x factor

void glm_translated_y(mat4 m, float y)

  translate existing transform matrix by y factor

  Parameters:
    [in, out] m affine transform
    [in] v y factor

void glm_translated_z(mat4 m, float z)

  translate existing transform matrix by z factor

  Parameters:
    [in, out] m affine transform
    [in] v z factor

void glm_rotated_x(mat4 m, float angle, mat4 dest)

  rotate existing transform matrix around X axis by angle and store result in dest

  Parameters:
    [in] m affine transform
    [in] angle angle (radians)
    [out] dest rotated matrix

void glm_rotated_y(mat4 m, float angle, mat4 dest)

  rotate existing transform matrix around Y axis by angle and store result in dest

  Parameters:
    [in] m affine transform
    [in] angle angle (radians)
    [out] dest rotated matrix

void glm_rotated_z(mat4 m, float angle, mat4 dest)

  rotate existing transform matrix around Z axis by angle and store result in dest

  Parameters:
    [in] m affine transform
    [in] angle angle (radians)
    [out] dest rotated matrix

void glm_rotated(mat4 m, float angle, vec3 axis)

  rotate existing transform matrix around Z axis by angle and axis

  Parameters:
    [in, out] m affine transform
    [in] angle angle (radians)
    [in] axis axis

void glm_rotated_at(mat4 m, vec3 pivot, float angle, vec3 axis)

  rotate existing transform around given axis by angle at given pivot point (rotation center)

  Parameters:
    [in, out] m affine transform
    [in] pivot pivot, anchor point, rotation center
    [in] angle angle (radians)
    [in] axis axis

void glm_spinned(mat4 m, float angle, vec3 axis)
  rotate existing transform matrix around given axis by angle around self (doesn’t affected by position)
  Parameters:
    [in, out] m affine transform
    [in] angle angle (radians)
    [in] axis axis