我如何找到一个点在平面上的正交投影 [英] How do I find the orthogonal projection of a point onto a plane
本文介绍了我如何找到一个点在平面上的正交投影的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
假设我有点 (x,y,z) 和带有点 (a,b,c) 和法线 (d,e,f) 的平面.我想找到第一个点在平面上的正交投影结果的点.我在 3d 图形编程中使用它.我想在平面上实现某种剪裁.
Lets say I have point (x,y,z) and plane with point (a,b,c) and normal (d,e,f). I want to find the point that is the result of the orthogonal projection of the first point onto the plane. I am using this in 3d graphics programming. I want to achieve some sort of clipping onto the plane.
推荐答案
点 q = (x, y, z)
投影到由点 p = 给定的平面上(a, b, c)
和一个正常的 n = (d, e, f)
是
The projection of a point q = (x, y, z)
onto a plane given by a point p = (a, b, c)
and a normal n = (d, e, f)
is
q_proj = q - dot(q - p, n) * n
这个计算假设 n
是一个单位向量.
This calculation assumes that n
is a unit vector.
这篇关于我如何找到一个点在平面上的正交投影的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文