我如何确定哪些是从画面感动在三维空间? [英] How do I determine what is touched in 3D space from the screen?

查看:91
本文介绍了我如何确定哪些是从画面感动在三维空间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何使用gl.gluUnproject在我的OpenGL ES 1.1的Andr​​oid应用程序,以确定当用户触摸屏幕?什么选择

How do I use gl.gluUnproject in my OpenGL ES 1.1 android app to determine what is selected when the user touches the screen?

我的理解是,在一条线上的触摸事件的结果,我要找到第一个物,它相交。

My understanding is that the touch event results in a line and I have to find the first "thing" it intersects with.

是否有关于如何做到这一点的任何教程?

Are there any tutorials on how to do this?

推荐答案

一想到我是缓存调用gluProject的结果。这可能仅仅是实用,当你正在处理一个固定的摄像头。在摄像头角度的任何变化的结束,我可以再生的touchables此缓存。

One thought I had was to cache the results of calling gluProject. This might only be practical when you are dealing with a fixed camera. At the end of any change in camera perspective, I can regenerate this cache of "touchables".

这也有保证,我只测试输入对的事情,将要被触摸响应的好处。

This also has the added benefit of ensuring that I'm only testing input against things that will respond to being touched.

我想AP preciate这种方法的任何想法!

I'd appreciate any thoughts on this approach!

这篇关于我如何确定哪些是从画面感动在三维空间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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