How can I find out if point is within a triangle in 3D?

前端 未结 3 1296
猫巷女王i
猫巷女王i 2021-01-24 04:05

I need an algorithm (3D), which would determine if point belongs to a triangle. And also if it does I want to know the distance between some point in triangle and a another poin

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-24 04:33

    This seems like the 3D equivalent of Data structure to query points which lie inside a triangle. You could use the same method in 3D: in 3D, a plane cuts the space in two halves: a point is either at one side of the plane or at the other side. The wedge-shape is a collection of planes: just combine the which_side_of_the_plane information for a given point with all the planes that build up the wedge.

提交回复
热议问题