我知道如何检查一个点是否在 2d 线上,但我想在 3D 中执行此操作。有任何想法吗?
// slope from point 1 to point 3
var p13:Number = (Math.atan2 (end.x - start.x, end.y - start.y)) * toDegrees;
// slope from point 1 to point 2 -- matches?
var p12:Number = (Math.atan2 (point.x - start.x, point.y - start.y)) * toDegrees;
return Math.round(p12) == Math.round(p13);
最佳答案
对向量进行归一化。检查法线是否匹配。
找到最大值,将所有其他值除以该值,从而得到向量法线。
一条线上的任何点都应该具有相同的向量法线。
关于3d - 检查点是否在 3d 线上?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5043745/