affine-post.rst 3.8 KB

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