如何检测触摸的面积在Android开放GL ES? [英] How to detect the area of touch in open gl es in android?

查看:316
本文介绍了如何检测触摸的面积在Android开放GL ES?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经设计了.OBJ格式的3D模型,并使用min3d框架进口。它用不同颜色的立方体。我想给一个消息,并为吐司特定颜色时特定颜色的侧感动。如何在Android 1.6的做到这一点?

I have designed a 3D model in .obj format and imported using min3d framework. Its a cube with different colors. I want to give a Toast with a message for a particular color when the side of that particular color is touched. How do I do this in android 1.6 ?

推荐答案

我不知道有关细节的Andr​​oid / OpenGL的ES,但一般的:

I'm not sure about the particulars in android/OpenGL-es, but in general:

您必须计算开始于摄像机的位置,并通过屏幕坐标pressed线/点击/等,并确定这条线相交的对象。

You have to calculate a line that starts at the camera's position and passes through the screen coordinate pressed/clicked/etc and determine where that line intersects your object.

这就是所谓的...是啊是:采摘。对于谷歌搜索的OpenGL采摘翻了一个教程或三:

It's called... ah yes: "picking". Googling for "opengl picking" turned up a tutorial or three:

http://www.lighthouse3d.com/opengl/picking/

http://gpwiki.org/index.php/OpenGL:Tutorials:Picking
...

我只是用Google搜索OpenGL的采摘。这两个是前两个环节,接下来就是一个FAQ条目,紧接着又教程。你的想法。

I just googled "opengl picking". Those two are the first two links, the next is a FAQ entry, followed by another tutorial. You get the idea.

一旦你知道什么叫它,查找信息变得更加容易。好猎手。

Once you know what its called, finding information gets much easier. Good hunting.

这篇关于如何检测触摸的面积在Android开放GL ES?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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