Log in or register to post comments

How do I get an image's target name

December 7, 2019 - 10:51am #1

HI there,How do I get the image target's name when Vuforia has targeted the image?

 

I have several image targets un my scene. In another scrip I send a:

GetRequest("https://api.themoviedb.org/3/movie/" + "Image Target Name" 

I need to know the "Image Target Name" in orde to fetch the data from each individual Image target.

 

this is the piece off code that does not work (API-KEY is my private API key number):

IEnumerable<TrackableBehaviour> tbs = TrackerManager.Instance.GetStateManager().GetTrackableBehaviours();

        foreach (TrackableBehaviour tb in tbs)

        {

          

            Debug.Log("<color=yellow>" + "- A: "+tb.name +"- B: "+ tb.Trackable.ID +"- C: "+ tb.TrackableName +"- D: "+ tb.Trackable.Name+"</color>");

            for(int i=0; i<idmovie.Length;i++)

            {

                if(tb.name == idmovie[tb.Trackable.ID-1])

                {

                    GetRequest("https://api.themoviedb.org/3/movie/" + tb.name + "?api_key=<private Api key number>");

                }

            }

          

        }

 

Thank you

 

Admin: I removed the Api key as this should remain private

How do I get an image's target name

December 9, 2019 - 12:58am #2

Hi,

If you use the data stored on the device than  .TrackleName should help you. more info below:https://library.vuforia.com/content/vuforia-library/en/reference/unity/classVuforia_1_1TrackableBehaviour.html#ae1454d82fe3ec6cd8a3ac554ef74559d

If you use your Cloud Reco solution .TargetName should provide the name, more info below:

https://library.vuforia.com/content/vuforia-library/en/reference/unity/classVuforia_1_1TargetFinder_1_1TargetSearchResult.html#a956296549a30b3093652ca8d10008a28

We use both in our Core Sample app, available via Unity Store.

.TrackName -> DefaultTrackableEventHandler.cs

.TargetName -> CloudContentManager.cs

Thank you.

Vuforia Engine Support

Log in or register to post comments