从鼠标坐标的三维点,三角形相交?角形、鼠标、标的

2023-09-09 21:18:20 作者:时代佳人

我知道如何一个点,一个三角形的测试交集。

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

...但我不明白,我怎么可以移动该点的起始位置在屏幕上飞机precisely用我的鼠标坐标,所以点角应根据所在鼠标光标的变化屏幕上,这也应该很好地工作,无论我用我的OpenGL应用程序哪个角度看的角度,所以该点的角度将是对不同的角度不同的角度... gluPerspective()是函数的IM谈论。

...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 has more information if you run into problems.

干杯!