从鼠标坐标的三维点,三角形相交? [英] Point-triangle intersection in 3d from mouse coordinates?

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

问题描述

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

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.

<一个href="http://www.google.se/search?hl=sv&rlz=1G1GGLQ%5FSVSE328&q=ray%2Bpicking%2BgluUnProject&btnG=S%C3%B6k&meta="相对=nofollow>谷歌有更多的信息,如果你遇到了问题。

Google has more information if you run into problems.

干杯!

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

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