简体   繁体   English

3D Java中的平面线交叉

[英]Plane-Line Crossing in 3D Java

This post is a reply to: 3D Ray-Quad intersection test in java Because I can't yet comment. 这篇文章是对以下内容的回复: java中的3D Ray-Quad相交测试因为我还不能发表评论。

My question is, how did they get: A point M belongs to this plane iff it satisfies this equation: n . 我的问题是,它们如何得到:如果满足以下等式,则点M属于该平面:n。 ( M - S1 ) = 0 (M-S1)= 0

How is the (dotProduct(n, (M - S1)) == 0) suppose to tell us that the ray intersects the quad? (dotProduct(n,(M-S1))== 0)应该如何告诉我们射线与四边形相交?

In my opinion Wikipedia answers this question quite well: Wiki 我认为Wikipedia很好地回答了这个问题: 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. 具体而言,设r0为某点P0 =(x0,y0,z0)的位置向量,设n =(a,b,c)为非零向量。 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. 由点P0和向量n确定的平面由具有位置向量r的那些点P组成,这样从P0到P绘制的向量垂直于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 回顾两个向量在且仅当其点积为零时是垂直的,因此可以将所需平面描述为所有点r的集合,使得

With other words you have a normal vector of a plane and a vector created by a point of the plane and the point you are checking if it is on the plane. 换句话说,您有一个平面的法线向量和一个由该平面的点和要检查的点在平面上创建的向量。 The dot-product tells you something about the angle between the two vector. 点积告诉您有关两个向量之间的角度的信息。 Therefore if the vector is parallel to the plane, the point has to be on the plane. 因此,如果矢量平行于平面,则该点必须在平面上。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM