Also note: I did not have to name the target ID as "a1"
You have to name the target ID after the names of the images in your myar.wtc. So, if the four images in myar.wtc file were "image1.jpg", "image2.jpg", image3.jpg", and "image4.jpg", and you wanted AR.Trackable2DObject to track the first one, you'd need to construct it as...
var pageOne = new AR.Trackable2DObject(this.tracker, "image1", { drawables: { cam: overlayOne } });
s
sunil vishnu
said
over 10 years ago
I am facing a similar issues as well. I had createda a target collection called myar.wtc with 4 images that has 3 star rating. When I use it as shown below nothing works:
this.tracker = new AR.Tracker("myar.wtc", {
onLoaded: this.worldLoaded
});
// Create overlay for page one
var imgOne = new AR.ImageResource("a1.png");
var overlayOne = new AR.ImageDrawable(imgOne, 1, {
offsetX: -0.15,
offsetY: 0
});
var pageOne = new AR.Trackable2DObject(this.tracker, "pageOne", {
drawables: {
cam: overlayOne
}
});
But when I change the wtc file back to the original one from the sample ( magazine.wtc) and replace in the above line of code like below it works :
this.tracker = new AR.Tracker("magazine.wtc", {
onLoaded: this.worldLoaded
});
Also note: I did not have to name the target ID as "a1"
This would make me think that my custom target collection file is not recognised... am I missing something ?
N
Nicolas Goell
said
over 10 years ago
Hello Jeru,
After changing the target collection, you also need to change the target identifier, i.e. if your target image is named 'pageOne.jpg' then you need to specify the target ID 'pageOne' when creating the AR.Trackable2DObject.
var pageOne = new AR.Trackable2DObject(this.tracker, "pageOne", { drawables: { cam: overlayOne } });
Can you please check if that target ID is set properly?
Best regards,
Nicolas
J
Jeru Gasendo
said
over 10 years ago
Hello!
Hope someone can help me on this already. Just need to know how to make the target work properly.
Thanks!
J
Jeru Gasendo
said
over 10 years ago
Hi There,
I am very new with PhoneGap and AR Development and I've just downloaded the SDK and the plugin to experiment on the Sample "HelloImageRecognition". However, I can't seem to make the tracker/target work by changing it.
What I did;
Went to "Wikitude Target-Manager" page.
Uploaded a 2 star image and geneterated a WTC file of it
Placed the converted image into the "assets" folder world1_ImageRecognition_1_ImageOnTarget\assets
Run the application
Overlay don't show up
Hope you can help me on this.
But I've tried changing the overlay and it does work fine.
Jeru Gasendo