来自鼠标坐标的 3d 点三角形交点? [英] Point-triangle intersection in 3d from mouse coordinates?

查看:25
本文介绍了来自鼠标坐标的 3d 点三角形交点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道如何测试点和三角形之间的交点.

I know how to test intersection between a point and a triangle.

...但我不明白,我如何使用我的鼠标坐标将点的起始位置精确地移动到屏幕平面上,所以点角度应该根据鼠标光标在屏幕上的位置而变化,也无论我在我的 OpenGL 应用程序中使用哪个透视角,这都应该完美地工作,因此点角度在不同的透视角上会有所不同...... gluPerspective() 是我正在谈论的函数.

...But i dont get it, how i can move the starting position of the point onto the screen plane precisely by using my mouse coordinates, so the point angle should change depending on where mouse cursor is on the screen, also this should work perfectly no matter which perspective angle i am using in my OpenGL application, so the point angle would be different on different perspective angles... gluPerspective() is the function im talking about.

推荐答案

好吧,去试一下,猜猜你的意思.猜测是您想用鼠标选择对象.退房:

Well, gonna take a shot and guess what you mean. The guess is that you would like to pick objects with your mouse. Check out:

glUnProject.

这会将屏幕坐标转换回 3d 世界坐标.

This transforms the screen coordinates back into 3d world coordinates.

Google 会提供更多信息.

干杯!

这篇关于来自鼠标坐标的 3d 点三角形交点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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