A camera (columns: eye, center, up) in the coordinates a rigid
transform m (4x4) takes it to: the points moved, the up direction turned.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | m(4,4) |
rigid transform |
||
| real(kind=wp), | intent(in) | :: | cam(3,3) |
(columns: eye, center, up) |
pure function transform_camera(m, cam) result(out) real(wp), intent(in) :: m(4,4) !! rigid transform real(wp), intent(in) :: cam(3,3) !! (columns: eye, center, up) real(wp) :: out(3,3) out(:, 1) = matmul(m(1:3, 1:3), cam(:, 1)) + m(1:3, 4) out(:, 2) = matmul(m(1:3, 1:3), cam(:, 2)) + m(1:3, 4) out(:, 3) = matmul(m(1:3, 1:3), cam(:, 3)) end function transform_camera