affine-post.rst 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. .. default-domain:: C
  2. 3D Affine Transforms (post)
  3. ================================================================================
  4. Post transfrom functions are similar to pre transform functions except order of application is reversed.
  5. Post transform functions are applied after the object is transformed with given (model matrix) transfrom.
  6. Ther are named af
  7. Table of contents (click to go):
  8. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  9. Functions:
  10. 1. :c:func:`glm_translated_to`
  11. #. :c:func:`glm_translated`
  12. #. :c:func:`glm_translated_x`
  13. #. :c:func:`glm_translated_y`
  14. #. :c:func:`glm_translated_z`
  15. #. :c:func:`glm_rotated_x`
  16. #. :c:func:`glm_rotated_y`
  17. #. :c:func:`glm_rotated_z`
  18. #. :c:func:`glm_rotated`
  19. #. :c:func:`glm_rotated_at`
  20. #. :c:func:`glm_spinned`
  21. Functions documentation
  22. ~~~~~~~~~~~~~~~~~~~~~~~
  23. .. c:function:: void glm_translated_to(mat4 m, vec3 v, mat4 dest)
  24. translate existing transform matrix by *v* vector and store result in dest
  25. Parameters:
  26. | *[in]* **m** affine transfrom
  27. | *[in]* **v** translate vector [x, y, z]
  28. | *[out]* **dest** translated matrix
  29. .. c:function:: void glm_translated(mat4 m, vec3 v)
  30. translate existing transform matrix by *v* vector
  31. and stores result in same matrix
  32. Parameters:
  33. | *[in, out]* **m** affine transfrom
  34. | *[in]* **v** translate vector [x, y, z]
  35. .. c:function:: void glm_translated_x(mat4 m, float x)
  36. translate existing transform matrix by x factor
  37. Parameters:
  38. | *[in, out]* **m** affine transfrom
  39. | *[in]* **v** x factor
  40. .. c:function:: void glm_translated_y(mat4 m, float y)
  41. translate existing transform matrix by *y* factor
  42. Parameters:
  43. | *[in, out]* **m** affine transfrom
  44. | *[in]* **v** y factor
  45. .. c:function:: void glm_translated_z(mat4 m, float z)
  46. translate existing transform matrix by *z* factor
  47. Parameters:
  48. | *[in, out]* **m** affine transfrom
  49. | *[in]* **v** z factor
  50. .. c:function:: void glm_rotated_x(mat4 m, float angle, mat4 dest)
  51. rotate existing transform matrix around X axis by angle
  52. and store result in dest
  53. Parameters:
  54. | *[in]* **m** affine transfrom
  55. | *[in]* **angle** angle (radians)
  56. | *[out]* **dest** rotated matrix
  57. .. c:function:: void glm_rotated_y(mat4 m, float angle, mat4 dest)
  58. rotate existing transform matrix around Y axis by angle
  59. and store result in dest
  60. Parameters:
  61. | *[in]* **m** affine transfrom
  62. | *[in]* **angle** angle (radians)
  63. | *[out]* **dest** rotated matrix
  64. .. c:function:: void glm_rotated_z(mat4 m, float angle, mat4 dest)
  65. rotate existing transform matrix around Z axis by angle
  66. and store result in dest
  67. Parameters:
  68. | *[in]* **m** affine transfrom
  69. | *[in]* **angle** angle (radians)
  70. | *[out]* **dest** rotated matrix
  71. .. c:function:: void glm_rotated(mat4 m, float angle, vec3 axis)
  72. rotate existing transform matrix around Z axis by angle and axis
  73. Parameters:
  74. | *[in, out]* **m** affine transfrom
  75. | *[in]* **angle** angle (radians)
  76. | *[in]* **axis** axis
  77. .. c:function:: void glm_rotated_at(mat4 m, vec3 pivot, float angle, vec3 axis)
  78. rotate existing transform around given axis by angle at given pivot point (rotation center)
  79. Parameters:
  80. | *[in, out]* **m** affine transfrom
  81. | *[in]* **pivot** pivot, anchor point, rotation center
  82. | *[in]* **angle** angle (radians)
  83. | *[in]* **axis** axis
  84. .. c:function:: void glm_spinned(mat4 m, float angle, vec3 axis)
  85. | rotate existing transform matrix around given axis by angle around self (doesn't affected by position)
  86. Parameters:
  87. | *[in, out]* **m** affine transfrom
  88. | *[in]* **angle** angle (radians)
  89. | *[in]* **axis** axis