如何使一个3D的每个组件OpenGL在Android的触摸对象? [英] How to make each component of a 3D OpenGL object touchable in Android?

查看:563
本文介绍了如何使一个3D的每个组件OpenGL在Android的触摸对象?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

让我们说我在Android的使用GLSurfaceView显示的3D汽车模型。该模型包括许多组成部分,是可以控制他们每个人或让他们每个人的反应单独触摸事件?例如,如果我要选择一个车轮,我需要做的是触摸轮。

let's say I have a 3d car model displayed using GLSurfaceView in Android. This model consists of many components, is that possible to control each of them or make each of them response to touch events individually? for example, if I want to select one wheel, what I need to do is touch the wheel.

推荐答案

我认为你正在寻找射线采摘或光线交叉。

I think you are looking for ray picking or ray intersection.

这答案有一个链接到一个样品的iOS /视频我相信这是你所追求的。 <一href="http://gamedev.stackexchange.com/questions/12360/how-do-you-determine-which-object-surface-the-users-pointing-at-with-lwjgl/12367#12367">http://gamedev.stackexchange.com/questions/12360/how-do-you-determine-which-object-surface-the-users-pointing-at-with-lwjgl/12367#12367

This answer has a link to a iOS sample/video which I believe is what you are after. http://gamedev.stackexchange.com/questions/12360/how-do-you-determine-which-object-surface-the-users-pointing-at-with-lwjgl/12367#12367

另一个相关的SO问题: 实施雷采摘

Another related SO question: Implementing Ray Picking

这应该让你开始你需要做的。

That should get you started on what you need to do.

这篇关于如何使一个3D的每个组件OpenGL在Android的触摸对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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