如何使一个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 /视频我相信这是你所追求的。 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.