"We offer new support options and therefor the forums are now in read-only mode! Please check out our Support Center for more information." - Vuforia Engine Team

How to get a tap event on the 3D model.

Hi, I am working on the ImageTargets project. What i want to do is On Tap of 3D Model/Object i want to start a new new Activity in Android. So, how can i get a onClick event on the 3D object. Thanks.

how can i also get a tap event for the marker. i am very new to qcar, so can u please tell me where can i find the concerned code and also what code change needs to be done

Handling tap events isn't built into the SDK. The Dominoes sample does have some code for selecting 3D objects on tap, but you'll have to dig into it a bit to reuse it. That sample intersects the touch against object-orientented bounding boxes (you have to define these per 3D object).

hi kim ... im droping this ... because i feel its 2 difficult .. instead what ill try to find out is "Tap on marker"(on device screen). please provide me with some code snippet for the same ... Note: i have tried virtual button ...

Hi kim ... so now what I'm planing to do is: 1. get x,y (in java) of the tap and pass it to native code 2. get the area of marker. 3. check if x,y lies in markers area. Please tell me how can i achieve above thing ..

The problem is that the x,y coordinates returned by a tap are in screen space. You'll want to project that to target space to determine whether or not a target was touched. Here are the steps for determining whether a target was touched in the ImageTargets sample. 1.

Hi Kim, Thanks for the help..i implemented all the changes as u mentioned and we are able to get tap event but, we are unable to get the LinePlaneIntersection values, we are getting as NaN. please let us know what exactly we are missing ...Thanks in advance we change the data type of tapX and ta

Sorry, that's outside the scope of what I can help with. You'll want to research 3D object picking, there are lots of approaches to this problem. The Dominoes sample uses one approach, with object-aligned bounding boxes that surround the 3D models (you have to define these).

The checkIntersectionLine function only works with cubes, it cannot be used to check for intersections against a mesh. You'll need to create a bounding box around your mesh to use that function. If you want finer-grained selection you'll have to find another solution, sorry! - Kim

i tried the same but during cygwin build getting error in ImageTarget.cpp--- 1.getInstance is not member of qcar::Tracker. 2.qcar::Tracker has no member named getCameraCalibration. can anyone help me with this?

calibronbon

Tue, 04/03/2012 - 05:08

I succesfully implemented tap event; however, there are two issue; 1 - When camera position is moved to up or down, as natural the target view is scaled in the real world and this event can detect that, before moving its height is for example, 400 unit, after moving it became 250 unit and this tap