@anonymous - I don't think that the ray's direction is originally orthogonal to the plane. It can be at any angle. The inv(M) matrix has the characteristic of transforming the triangle into a unit triangle and making the ray's direction orthogonal to the plane

why is ray's direction orthogonal to the plane?

@anonymous - I don't think that the ray's direction is originally orthogonal to the plane. It can be at any angle. The inv(M) matrix has the characteristic of transforming the triangle into a unit triangle and making the ray's direction orthogonal to the plane