Putting intent when the user clicks the objects?

66 views
Skip to first unread message

Minsung

unread,
Jul 16, 2010, 4:32:37 AM7/16/10
to AndAR Android Augmented Reality
Hi,

I'm a student currently got interested in Android Apps and AR
browsers.

I was looing into the source code of "AndAR", "AndARModelViewer",
"AndARSampleProject".
And in the file "CustomActivity.java" in "AndARSamleProject",

someObject = new CustomObject("test", "patt.hiro", 80.0, new double[]
{0,0});
artoolkit.registerARObject(someObject);
someObject = new CustomObject("test", "android.patt", 80.0, new
double[]{0,0});
artoolkit.registerARObject(someObject);
someObject = new CustomObject("test", "barcode.patt", 80.0, new
double[]{0,0});
artoolkit.registerARObject(someObject);

It seems that I can put different objects on each marker. Can I?
For example, bench model for bench pattern, and plant model for plant
pattern.
I can't sure whether I can or not, becuase the "AndARModelViewer"
shows different models, but no regard with patterns.

One more thing,
I want to make an action if the user clicks on the object.
For example, linking to web browser, showing more information and so
on.
So I need to make an intent if the object is clicked.
Which part of source I can modify for this feature?

To summerize,
1. whether I can show different modles depending on markers.
2. how to modify to make an intent when the user clicks on the
objects.

Thanks for reading,
Minsung

Suzy Deffeyes

unread,
Jul 16, 2010, 3:52:52 PM7/16/10
to andar_android_a...@googlegroups.com, AndAR Android Augmented Reality
Hi Minsung

So in your code snippet below, you can have CustomObject class for the first type of thing you want to render, and then derive a subclass and override the draw routine for a different thing. So android.patt would render one thing, and hiro.patt another.

The intent launching doesn't work with the current code, and there is another problem.... I don't know of an easy way to click on a 3d object. The click is in 2d window coordinates, and the objects are in 3d. So figuring out what object you clicked on isn't easy.

Suzy

Sent from my iPad

tdo...@googlemail.com

unread,
Jul 25, 2010, 7:24:02 AM7/25/10
to AndAR Android Augmented Reality
Hi Minsung,
The sample project is not capable of displaying 3d models... I think I
have to change that, as it confuses people.
As suzy said, you have to implement your own draw method in order to
draw something different then the green cube.

Well object's can not easily be clicked. Though it's not impossible.
You have access to the transformation matrix of every object in the
camera coordinate system.
Have a look at this website, containing further information about the
coordinate system of ARToolkit: http://www.hitl.washington.edu/artoolkit/documentation/cs.htm

Regards
Tobi

On 16 Jul., 21:52, Suzy Deffeyes <suzy...@gmail.com> wrote:
> Hi Minsung
>
> So in your code snippet below, you can have CustomObject class for the first type of thing you want to render, and then derive a subclass and override the draw routine for a different thing. So android.patt would render one thing, and hiro.patt another.
>
> The intent launching doesn't work with the current code, and there is another problem.... I don't know of an easy way to click on a 3d object. The click is in 2d window coordinates, and the objects are in 3d. So figuring out what object you clicked on isn't easy.
>
> Suzy
>
> Sent from my iPad
>

Minsung

unread,
Jul 26, 2010, 9:50:20 AM7/26/10
to AndAR Android Augmented Reality
Hi Suzy

Thanks for your comment.
I applied different objects on different markers by changing draw
method :D

Minsung

p.s. Wow iPad :)

On Jul 17, 4:52 am, Suzy Deffeyes <suzy...@gmail.com> wrote:
> Hi Minsung
>
> So in your code snippet below, you can have CustomObject class for the first type of thing you want to render, and then derive a subclass and override the draw routine for a different thing. So android.patt would render one thing, and hiro.patt another.
>
> The intent launching doesn't work with the current code, and there is another problem.... I don't know of an easy way to click on a 3d object. The click is in 2d window coordinates, and the objects are in 3d. So figuring out what object you clicked on isn't easy.
>
> Suzy
>
> Sent from my iPad
>

Minsung

unread,
Jul 26, 2010, 9:58:41 AM7/26/10
to AndAR Android Augmented Reality
Hi Tobi

Thanks for your comment :)
My friend and I have discussed about click event,
and he has an idea that because we display the remote controller UI,
we make different objects for each buttons.
With this idea, it turns figuring out which part of the object is
clicked to figuring out which object is clicked.
I think this idea lead us to the simpler problem.
So I'm looking into how to handle it.

Do you have any idea? :)

Regards,
Minsung

On Jul 25, 8:24 pm, "tdom...@googlemail.com" <tdom...@googlemail.com>
wrote:

Minsung

unread,
Jul 27, 2010, 6:07:22 PM7/27/10
to AndAR Android Augmented Reality
Ye still I need to study coordinate system.

Thanks for the link,Tobi!
> > > > Minsung- Hide quoted text -
>
> - Show quoted text -

Zonk1281

unread,
Nov 30, 2013, 10:27:29 AM11/30/13
to andar_android_a...@googlegroups.com
Hey, have you resolved this problem? I wanna also create an app with Andar that make an action, when the user clicks the object. Could you help me?
Reply all
Reply to author
Forward
0 new messages