How to make each component of a 3D OpenGL object touchable in Android? [closed]

社会主义新天地 提交于 2019-12-14 03:36:27

问题


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.


回答1:


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

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

Another related SO question: Implementing Ray Picking

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



来源:https://stackoverflow.com/questions/28243620/how-to-make-each-component-of-a-3d-opengl-object-touchable-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!