如何找到一个点的正交投影到平面 [英] How do I find the orthogonal projection of a point onto a plane

查看:407
本文介绍了如何找到一个点的正交投影到平面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以说我有一点(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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆