I am working on a 3D view, I have a shape in a plan that is set in space. In theory I would need to do it for any shape, but let's start with a rectangle ABCD.
Let's call the 4 points A,B,C,D, with coordinates Xa,Ya,Za; Xb,Yb,Yc; Xc,Yc,Zc and Xd,Yd,Zd.
Then I have a vector, defined by 2 points P1 and P2.
I need to check if that vector goes through rectangle. I already can say where the vector meets the rectangle's plan, but how can I check if the point is inside the shape or outside?