wpf3d 矩形命中测试
我有一个包含驻留在 Viewport3D 中的 3D 对象的应用程序,我希望用户能够通过在屏幕上拖动矩形来选择它们。
我尝试在 Viewport3D 上应用 GeometryHitTestParameters (具有矩形几何形状)以获得结果,但我收到一个异常,告诉我 Viewport3D 不支持它。仅支持 PointHitTestParameters。
有谁知道任何优雅的方法来做到这一点,除了我自己计算(例如 - 将所有 3D 对象投影到 2D 并与矩形进行手动几何交叉)?
I have an application with 3D objects that reside in Viewport3D and I want the user to be able to select them by dragging a rectangle on the screen.
I tried applying GeometryHitTestParameters (with rectangle geometry) on the Viewport3D in order to get the results, but I get an exception telling me that it is unsuppoted with Viewport3D. Only PointHitTestParameters are supported.
Does anybody know any elegant way to do it, except calculating it myself (for example - projecting all 3D objects to 2D and doing manual geometry intersections with a rectangle)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我怀疑是否有比迭代选定的矩形点更好的方法:
请参阅 MSDN 如何:点击在 Viewport3D 中测试
I doubt there is better way than iterating through selected rectangle points:
See MSDN How to: Hit Test in a Viewport3D