Computer Science, asked by suryathoram123, 2 months ago

How do I find the intersection of a line and a quad?​

Answers

Answered by lnstaShadow
3

Answer

Compute the plane equation of the square (assuming the four points are coplanar),

Do a ray / plane intersection, this gives you either nothing (ray parallel to the square and I ignore the case where the ray is embedded in the plane) or a point,

Answered by ayushkum937
1

Answer

Compute the plane equation of the square (assuming the four points are coplanar),

Compute the plane equation of the square (assuming the four points are coplanar),Do a ray / plane intersection, this gives you either nothing (ray parallel to the square and I ignore the case where the ray is embedded in the plane) or a point,

Compute the plane equation of the square (assuming the four points are coplanar),Do a ray / plane intersection, this gives you either nothing (ray parallel to the square and I ignore the case where the ray is embedded in the plane) or a point,Once you have the intersection point, project it on a local 2D basis in the plane of the square, this will give the 2D coordinates (u, v) of the point on the plane,

Compute the plane equation of the square (assuming the four points are coplanar),Do a ray / plane intersection, this gives you either nothing (ray parallel to the square and I ignore the case where the ray is embedded in the plane) or a point,Once you have the intersection point, project it on a local 2D basis in the plane of the square, this will give the 2D coordinates (u, v) of the point on the plane,Check whether the 2D coordinates (u, v) are within the square (assuming the four points form a parallelogram and you chose two adjacent edges for the local 2D basis), if yes then there is intersection (and you have the u/v coordinates).

Similar questions