python - pyopengl - 有没有办法获得线和四边形/三角形的交点?
问题描述
我想知道 A 点和 B 点之间是否清晰可见(途中没有障碍物)。是否有一个功能可以做到这一点?
或者,pyopengl 中可以找到直线和四边形/三角形相交的函数也可以工作。如果我可以向函数提供四边形/三角形列表,则最好。
有任何想法吗?
解决方案
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.
推荐阅读
- excel - 如何在 Excel 中自定义自动归档
- python - 根据具有相同日期的几行添加新列
- python - 无法连接到 UI 对象按钮
- ios - 如何在移动应用程序(ios)上显示 GPS 坐标
- performance - Html-Webpack-Plugin 在多个 pug 文件上非常慢
- javascript - 如何修复错误“无法读取未定义的属性'调用'。检查元素时发生异常,检查'规则'方法”?
- reactjs - 如何在悬停时为图表图例符号设置动画?
- amazon-cloudformation - 在 Cloudformation 中使用 AWS Secrets manager 的 Secret
- python - 将 sphinx 模块导入 python
- php - PHP CURL 响应返回编码字符