If you suspect any js errors you should include the ade.js that comes with the SDK. It allows to test an AR experience inside the desktop browser and debugging with the built in developer tools.
Additionally on device debugging is possible on iOS and Android (4.4+), please have a look inside the SDK documentation on how to set it up.
M
Muhammet Ozcetin
said
over 9 years ago
Hi all,
I am currently busy with an Augmented Reality for my exams using javascript. But i got stuck on a certain point, and can't figure it out. So i was wondering if someone could help me out. The mission is to scan a picture which has to display a video then. After doing some research i ended up with this code structure:
var World = { loaded: false, rotating: false,
init: function initFn() { /* Disable all sensors in "IR-only" Worlds to save performance. If the property is set to true, any geo-related components (such as GeoObjects and ActionRanges) are active. If the property is set to false, any geo-related components will not be visible on the screen, and triggers will not fire.*/ AR.context.services.sensors = false; this.createOverlays(); },
createOverlays: function createOverlaysFn() { // Initialize Tracker var tracker = new AR.Tracker("res/screen/Target.wtc", { onLoaded: this.loadingStep });
var video = new AR.VideoDrawable("res/screen/thaepicbattle3.mp4", { offsetX: 0.2, offsetY: 0.2,
onLoaded: this.loadingStep, onLoaded: function videoLoaded() { playButton.enabled = true; },
var playButtonImg = new AR.ImageResource("img/playbutton.png"); var playButton = new AR.ImageDraweble(playbuttonImg, 0.2, { enabled: false, onClick: function playButtonClicked() { video.play(1); video.playing = true; },
OffsetX: video.offsetX, offsetY: video.offsetY
});
var trackable = new AR.Trackable2DObject(this.tracker, "3D-Wallpaper-HD", { drawables: { cam: },
onClick: function() { World.video.start(-1); },
onEnterFieldOfVision: function onEnterFieldOfViewFn () { if (video.playing) { video.pause (); } },
onExitFieldofVision: function onExitFieldofVieuw () { if (video.playing) { video.resume (); } }
Muhammet Ozcetin