Log in or register to post comments

Is it possible to create ImageTarget programmatically?

June 8, 2012 - 9:26am #1

Hi,
I'm trying to create ImageTarget programmatically.
But, It's not working.
I tested as below,

GameObject prefab = Instantiate(imageTarget) as GameObject;
ImageTargetBehaviour imgTargetBeh = prefab.GetComponent();
imgTargetBeh.DataSetPath = "QCAR/Test.xml";
imgTargetBeh.TrackableName = "Daddy";
imgTargetBeh.mInitializedInEditor = true;

GameObject myModel = Instantiate(Resources.Load("Daddy")) as GameObject;
myModel.transform.parent = prefab.transform;

I'm testing on iPhone.
Is there Anyone who knows about it?

Is it possible to create ImageTarget programmatically?

January 25, 2015 - 9:41pm #11

I am working in vuforia android from past 2 years .I could make the whole application dynamic ,but it dint have a 3d model.This time even 3d animation is  a requirement so we opted for unity 3d.I dont know anything about unity 3d.I could make a static app as documentation of this was very clear.I am not ableto create Image Target dynamicallyEven I am facing the same problem.Can anybody help me with this?

Is it possible to create ImageTarget programmatically?

January 25, 2015 - 9:41pm #10

I am working in vuforia android from past 2 years .I could make the whole application dynamic ,but it dint have a 3d model.This time even 3d animation is  a requirement so we opted for unity 3d.I dont know anything about unity 3d.I could make a static app as documentation of this was very clear.I am not ableto create Image Target dynamicallyEven I am facing the same problem.Can anybody help me with this?

Is it possible to create ImageTarget programmatically?

November 11, 2013 - 3:15am #9

Great to hear :)

Is it possible to create ImageTarget programmatically?

November 10, 2013 - 11:55pm #8

My confusion wa the creation of those trackables (ImageTargets). Now, I understand that when you load a new DataSet, the trackables are created AUTOMATICALLY. I will give it a try and come back here so post if it worked at the end.

Thx

 

EDIT: Yes, it worked. Once the DataSet is loaded, I use TrackerManager.INstace.GetStateManager().GetTrackanleBehaviours() to get all the newly created Imagetargets. Those Target are identifiable with the trackableBehavior.TrachableName (which is the Name you gave to the Image in the Target Manager in the vuforia developer site).

Is it possible to create ImageTarget programmatically?

November 4, 2013 - 7:01am #7

Ah, I thought you wanted to create an Image Target programatically, when it sounds like you simply want to activate a different Database, and then create a Trackable with some content attached to it.

This is described in the link you highlighted:

https://developer.vuforia.com/resources/dev-guide/swappable-databases-unity

What are you confused about?  Maybe worth breaking this down and trying to create a trackable at run-time from the existing dataset in the first instance e.g. Tarmac in the Image Target after removing it from the scene?

 

N

Is it possible to create ImageTarget programmatically?

November 4, 2013 - 6:41am #6

Isnt it theoretically possible, to download these .xml and .dat files from another source and load them at runtime with 

imagetracker.ActivateDataSet(newDataSet)

and assign the new objects iterating through the trackableBehaviours?

 

Is it possible to create ImageTarget programmatically?

November 4, 2013 - 5:19am #5

This is not possible at the moment.

The .dat and .xml for device databses are created using the online Target Manager, so you will not be able to access this at run-time.

The other option you have is to use Cloud Reco, wher it is possible to keep adding images during the life of the application, however this is meant to be updated from your own server using VWS API rather than trying to do this from the device (which is not recommended).

HTH

N

Is it possible to create ImageTarget programmatically?

November 4, 2013 - 4:33am #4

Bump

This thread is old and contains a very basic question. The link is broken and I am having the same problem :/

Does anyone can give code snippet of how to instantiate an ImageTarget programically having the .dat and the .xml files?

EDIT: I think I found the new link : https://developer.vuforia.com/resources/dev-guide/swappable-databases-unity But I am still confused of the fact of loading DataSets (which basically are Images) but never create the actual ImageTarget. Can anyone help?

Is it possible to create ImageTarget programmatically?

November 9, 2012 - 4:12pm #3

Check out the Adding content to a Trackable: section of the Swappable Dataset reference for an example of how to handle targets dynamically  ..

https://ar.qualcomm.at/sdk/android/Swappable%20Datasets%20-%20Android

Is it possible to create ImageTarget programmatically?

November 9, 2012 - 5:02am #2

I'm having the same problem. Did you ever find a solution for this? 

Log in or register to post comments