I started to work on a AR App project with wikitude.
Now I want to know if it's possible to spawn and target a label or HTMLDrawable by clicking on the camera image.
I tried to fetch the onClick event over a div overlay. This works good and I can spawn labels and stuff, but with the wrong distance to the tracker. This is based on different measurements: with the overlay, I can get the absolute offset to the phone display and the labels are based on the relative offset to the target.
So my question is: Is it possible to get the offsets relative to the target via onClick?
Kind regards
Mirko
D
Daniel Guttenberg
said
about 7 years ago
Hi Mirko,
my apologies for the delayed replay. Maybe this is what you are looking for:
this.video = new AR.VideoDrawable("assets/video.mp4", 0.5, {
offsetX: 0.123,
offsetY: 0.456,
onClick: function videoClicked() {
console.log(this.offsetX);
console.log(this.offsetY);
}
});
Output:
0.123
0.456
I just used an AR.VideoDrawable since I conveniently had the code at hand. This should work with the other drawables as well.
Mirko Rosenthal