首页 > 解决方案 > pyopengl - 有没有办法获得线和四边形/三角形的交点?

问题描述

我想知道 A 点和 B 点之间是否清晰可见(途中没有障碍物)。是否有一个功能可以做到这一点?

或者,pyopengl 中可以找到直线和四边形/三角形相交的函数也可以工作。如果我可以向函数提供四边形/三角形列表,则最好。

有任何想法吗?

标签: pythonopenglpyopengl

解决方案


In short, this is something that OpenGL isn't really going to help you with, and is more a job you are going to have to deal with. The easiest way is to use a physics engine like Bullet3D, where you would wrap all your objects in bounding boxes and intersect a ray from A to B with the scene to check if anything obstructs it.


推荐阅读