I figured out the click event on the main web view. For somre reason I was trying to add a listener to the body, but for somehow it wasn't registering. I ended up adding a div container that takes all the size of the camera. I'm now able to tap an enable things. Going back to my first question. Is there a way to know the level of confidence when the asset is mapped to the marker? At least an even that says marker is found so that I can map at that point?
Thanks,
M
M
Mike.cornell.009
said
almost 7 years ago
I succesfully have an example running with a marker I built myself on iOS. One issue that I'm having when the marker starts recognition is that it gitters a little until it settles. I'm trying to achieve 2 things.
1. I want the my element to draw on the marker when the level on confidence is good enough so that I know my asset won't gitter as its happening right now.
2. I want the recognition to take place when the user taps on the screen. As of right now, once it goes into camera mode recognition happens automatically. I have tried setting some onClick events unsuccesfully. I tried to pass enable from the imageDrawable to a global variable so the user can tap and make the element show. This is just a starters test for me to have control of when to draw. I haven't succesully found the click even to the camera itself and not the elemetns, is this even something exists? Here is the code so far:
var World = {
loaded: false,
init: function initFn() {
this.createOverlays();
},
imageEnabled : true,
createOverlays: function createOverlaysFn() {
this.tracker = new AR.ClientTracker("assets/tracker.wtc", {
onLoaded: this.worldLoaded
});
/* Create overlay for page one */
var imgOne = new AR.ImageResource("assets/imageOne.png");
var overlayOne = new AR.ImageDrawable(imgOne, 1, {
offsetX: -0.15,
offsetY: 0,
enabled : World.imageEnabled,
});
var pageOne = new AR.Trackable2DObject(this.tracker, "*", {
Mike.cornell.009