ace
ace

Reputation: 12024

How to detect click on an object in OpenGL ES in Android application?

In my Android application, I have a bunch of meshes in a collection that are moving around in 3D space. I want something to happen to the mesh when any one of the moving mesh (objects) are touched. How can I detect which object has been tapped / clicked?

Upvotes: 9

Views: 6999

Answers (2)

genpfault
genpfault

Reputation: 52082

Ray picking.

Upvotes: 3

Robby Pond
Robby Pond

Reputation: 73484

In your View, you will need to override onTouchEvent() and determine if the touch event occurred on one of your objects. The Android Dev Blog has some examples on handling touch events.

Upvotes: 5

Related Questions