Log in or register to post comments

Adding listener to teapot in ImageTargets

November 20, 2012 - 3:56am #1

Hello.

I'm still working on my edit of the ImageTargets sample. What I'm trying to do now is adding an onClickListener() or something to the 3d model (the teapot, in this case) so that I can show something when tapping on it (like the tracker name)

I made a few researches on this forum but apparently the only way to accomplish my goal is re-creating the 3d model in Unity and adding the listener there.

Is there another way? I really can't understand all the 3d part so I'd like to keep my hands off it if I can.

Thanks

Adding listener to teapot in ImageTargets

March 12, 2013 - 5:39am #4

Adding listener to teapot in ImageTargets

March 12, 2013 - 5:21am #3

Hi, 

I want to convert the 3D coordinates of a model to 2D screen coordinates , but I can't access to the link you gave.

Could you provide me any additional ressource , please .

Regards

Adding listener to teapot in ImageTargets

November 20, 2012 - 5:14am #2

Hi, if you don't feel comfortoable with getting into the details of the 3D part (as you say), then it's going to be difficult to do what you want here in Android or iOS (i.e. without using Unity);

however, if you feel like daring a bit more, you can always have a look at this post, which explains how to convert the 3D coordinates of a model to 2D screen coordinates that you can then compare with a point on screen (such as your touch point):

https://ar.qualcomm.at/content/aiming-objects

 

An alternative approach is the one presented in the Dominoes sample (have a look at the sample code); in this case, there are some utility functions to compute the intersection of a ray with the target rectangle; note that this does not work with a 3D model, but you could adjust the technique to use a scaled version of the target rectangle which roughly encompasses the size of your model (as projected to the screen); this would be just an approximation, but maybe it could be suffficient in some cases.

 

 

Log in or register to post comments