// Create the image resources that are used for the marker and the buttons
IrAndGeo.res.marker = new AR.ImageResource("assets/POI_Marker.png", {
onLoaded: IrAndGeo.loadingStepDone,
onError: IrAndGeo.errorLoading
});
IrAndGeo.res.buttonWeb = new AR.ImageResource("assets/YourShop_OpenWebsite.png", {
onLoaded: IrAndGeo.loadingStepDone,
onError: IrAndGeo.errorLoading
});
IrAndGeo.res.buttonStores = new AR.ImageResource("assets/YourShop_FindShops.png", {
onLoaded: IrAndGeo.loadingStepDone,
onError: IrAndGeo.errorLoading
});
IrAndGeo.res.indicator = new AR.ImageResource("assets/indicator1.png", {
onLoaded: IrAndGeo.loadingStepDone,
onError: IrAndGeo.errorLoading
});
IrAndGeo.res.indicator2 = new AR.ImageResource("assets/indicator2.png", {
onLoaded: IrAndGeo.loadingStepDone,
onError: IrAndGeo.errorLoading
});
IrAndGeo.res.detail = new AR.ImageResource("assets/detail.png", {
onLoaded: IrAndGeo.loadingStepDone,
onError: IrAndGeo.errorLoading
});
IrAndGeo.res.detail2 = new AR.ImageResource("assets/detail2.png", {
onLoaded: IrAndGeo.loadingStepDone,
onError: IrAndGeo.errorLoading
});
IrAndGeo.initIr();
IrAndGeo.loadingStepDone();
I cannot get any of the AR objects to show against "IR2" (imageTwo), trackable2DObject works fine.
Any help welcome, thanks in advance;
Andy
M
Martin Lechner
said
about 9 years ago
Hi Andy,
What wtc file are you using? The wtc file needs to contain all targets that you want to track. Maybe the second target is not in the wtc file, or the ID you are using to reference the target is wrong.
Best,
Martin
A
Andy Hawkes
said
about 9 years ago
Thanks for the reply - I am pretty sure my wrt file is correct with both images in the target build.
I have tested my code above using the multi-image example from the SDK (magazine.wrt / pageone and pageTwo images) and get the same result: The first image is recognised and AR elements displayed, the second image does nothing which leads me to think its my code within the .js file that is at fault.
I seem to have 2 problems I think:
If I set my code as below then I get no AR on either image (IR or IR2)
var trackable2DObject = new AR.Trackable2DObject(IrAndGeo.tracker, "IR", {
drawables: {
// cam:
cam:
}
});
which leads me to think I have a problem with the indicator2 and detail2Drawable.
If I set IR2 to show the cam elements from IR then I get nothing - so I dont think IR2 is being recognised either.
Im pretty confused when you combine this with the SDK example .wrt - pageTwo image wasnt working correctly.
Any help welcome
A
Andy Hawkes
said
about 9 years ago
Like so many of these things... the devil is in the detail - I had put the wrong name for the tracker against image 2
// Create the object by defining the tracker, target name and its drawables
var trackable2DObject = new AR.Trackable2DObject(IrAndGeo.tracker, "IR", {
drawables: {
cam:
}
});
var imageTwo = new AR.Trackable2DObject(IRAndGeo.tracker, "IR2", {
drawables: {
cam:
}
});
Once I renamed the tracker to IrAndGeo everything worked.
Andy Hawkes