检测触摸OpenGL的对象? [英] Detect touch on OpenGL object?

查看:97
本文介绍了检测触摸OpenGL的对象?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在开发使用OpenGL渲染图像的应用程序。

I am developing an application which uses OpenGL for rendering of the images.

现在我只是想确定我所drwn OpenGL的球体对象上的触摸事件。

Now I just want to determine the touch event on the opengl sphere object which I have drwn.

在这里,我在屏幕上绘制4的对象。现在我应该怎么来知道哪个对象已

Here i draw 4 object on the screen. now how should I come to know that which object has been

感动。我已经使用的onTouchEvent()方法。但它给我的只有X&放大器; Y坐标,但我的

touched. I have used onTouchEvent() method. But It gives me only x & y co-ordinates but my

对象被绘制在3D。

请大家帮忙,因为我是新来的OpenGL。

please help since I am new to OpenGL.

最好的问候, 〜阿努普

Best Regards, ~Anup

推荐答案

T谷歌IO有OpenGL的是如何使用谷歌车身在Android上的会话。的身体部位的选择是通过用纯色到一个隐藏缓冲器呈现他们每个人的完成,然后根据这是对触摸x中的颜色​​,y中的相应的对象可以被发现。出于性能的目的,围绕触摸点的20×20像素只有一小裁剪区域被渲染的方式。

t Google IO there was a session on how OpenGL was used for Google Body on Android. The selecting of body parts was done by rendering each of them with a solid color into a hidden buffer, then based on the color that was on the touch x,y the corresponding object could be found. For performance purposes, only a small cropped area of 20x20 pixels around the touch point was rendered that way.

这篇关于检测触摸OpenGL的对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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