3D 平面线交叉 Java

Plane-Line Crossing in 3D Java

此 post 是对以下内容的回复:3D Ray-Quad intersection test in java 因为我还不能发表评论。

我的问题是,他们是怎么得到的: 一个点 M 属于这个平面当且仅当它满足这个方程:n。 ( M - S1 ) = 0

(dotProduct(n, (M - S1)) == 0) 是如何告诉我们射线与四边形相交的?

我认为维基百科很好地回答了这个问题:Wiki

In a manner analogous to the way lines in a two-dimensional space are described using a point-slope form for their equations, planes in a three dimensional space have a natural description using a point in the plane and a vector orthogonal to it (the normal vector) to indicate its "inclination".

Specifically, let r0 be the position vector of some point P0 = (x0, y0, z0), and let n = (a, b, c) be a nonzero vector. The plane determined by the point P0 and the vector n consists of those points P, with position vector r, such that the vector drawn from P0 to P is perpendicular to n. Recalling that two vectors are perpendicular if and only if their dot product is zero, it follows that the desired plane can be described as the set of all points r such that

换句话说,你有一个平面的法向量和一个由平面的点和你正在检查它是否在平面上的点创建的向量。点积告诉您有关两个向量之间角度的信息。因此,如果矢量平行于平面,则该点必须在平面上。