Closed zhangjian94cn closed 4 years ago
since directions is (X, 3) (X can be multi-dimensional), normally if we want to multiply a 3x3 rotation matrix to the left we do:
R @ directions.T
but this gives a tensor of shape (3, X) which we need to transpose again. So finally what we want is
(R @ directions.T).T
which becomes
directions @ R.T
So the R.T is not actually multiplying the transpose of R, you know what I mean. This is a concise way for me if you understand this procedure.
Thank you very much!
rays_d = directions @ c2w[:, :3].T # (H, W, 3) transpose c2w to make it row-major order?