Decompose a transformation matrix into its translation, rotation, and scale components.
Value
A list with elements translation (numeric vector of length 3),
rotation (numeric vector of length 4, quaternion), and scale (numeric vector of length 3).
See also
Other matrix functions:
get_camera_matrix(),
matrix_add(),
matrix_compose(),
matrix_determinant(),
matrix_frustum(),
matrix_identity(),
matrix_invert(),
matrix_look_at(),
matrix_multiply(),
matrix_multiply_value(),
matrix_ortho(),
matrix_perspective(),
matrix_rotate(),
matrix_rotate_x(),
matrix_rotate_xyz(),
matrix_rotate_y(),
matrix_rotate_z(),
matrix_rotate_zyx(),
matrix_scale(),
matrix_subtract(),
matrix_trace(),
matrix_translate(),
matrix_transpose(),
set_shader_value_matrix()
Examples
result <- matrix_decompose(diag(4))
result$translation
#> x y z
#> 0 0 0
result$rotation
#> x y z w
#> 0 0 0 1
result$scale
#> x y z
#> 1 1 1
