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.
Asked
Active
Viewed 402 times
-2
-
1OpenGL knows nothing about the touch interface. So what have you tried? – Morrison Chang Jan 30 '15 at 20:02
-
Thanks. OpenGL indeed knows nothings about touch events, but GLSurfaceView provides several handling events, like onKeyDown, onTouchEvent. But all of them are used to control the whole 3D object, what I am trying to achieve is to control each part of the object. – Sam003 Jan 30 '15 at 20:07
-
1Touch Events have X and Y, what happens when they fire in a particular bounded area which would map to a part of your object is up the developer. Determining the shape/position of the bounded area is also up to the developer. How the 3D model maps to a valid bounded area is also up to the developer. Your question is still too broad. – Morrison Chang Jan 30 '15 at 20:31
-
Hi, Morrison. Really appreciate. The bounded area idea is actually what I am looking for. But the boundary of a 3D component could be very complex. Any idea to achieve that will be appreciated. – Sam003 Jan 30 '15 at 20:45
-
Hi, @genpfault. Why my post get downgraded please? – Sam003 Jan 30 '15 at 20:47
1 Answers
2
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.

Community
- 1
- 1

Morrison Chang
- 11,691
- 3
- 41
- 77