Log in or register to post comments

UDT keep track of trackable to delete or replace

May 30, 2013 - 2:49pm #1

Suppose the user did not define their trackable properly the first time (ie off at an angle, but still recognizable on same marker in other angles), how do you reference the right trackable to delete and retrack in mBuiltDataSet.Destroy()?

UDT keep track of trackable to delete or replace

May 31, 2013 - 12:19pm #8

(up)

UDT keep track of trackable to delete or replace

May 30, 2013 - 7:25pm #7

DavidBeard wrote:

An ImageTarget's GameObject can be referenced from its ImageTargetBehavior component, here are some examples using the TrackableBehaviour, which ImageTargetBehavior inherits from - https://developer.vuforia.com/resources/dev-guide/swappable-databases-unity

I guess what I mean is that foreach(trackable in trackables...) ... referencing trackable doesn't seem to allow calling trackable.GetComponent<ImageTargetBehaviour>, as trackable doesn't contain a def for GetComponent

I'm still not sure how you are referencing ImageTargetBehaviour or the parent gameobject of the trackable... 

UDT keep track of trackable to delete or replace

May 30, 2013 - 6:56pm #6

DavidBeard wrote:

To obtain child objects of the IT GameObject you can provide a path to the go.transform.Find([path]) method.

http://docs.unity3d.com/Documentation/ScriptReference/Transform.Find.html

 

How do you know the child object you get via Find() corresponds to the trackable you have destroyed or referenced in the loop snippet below? 

UDT keep track of trackable to delete or replace

May 30, 2013 - 6:34pm #5

An ImageTarget's GameObject can be referenced from its ImageTargetBehavior component, here are some examples using the TrackableBehaviour, which ImageTargetBehavior inherits from - https://developer.vuforia.com/resources/dev-guide/swappable-databases-unity

To obtain child objects of the IT GameObject you can provide a path to the go.transform.Find([path]) method.

http://docs.unity3d.com/Documentation/ScriptReference/Transform.Find.html

UDT keep track of trackable to delete or replace

May 30, 2013 - 4:43pm #4

how do you reference the child gameobject in the imagetarget that is destroyed - this is for runtime edits of the child image target in the udt's. 

UDT keep track of trackable to delete or replace

May 30, 2013 - 4:03pm #3

It seems that if you just call mBuiltDataSet.Destroy(trackable), the cloned ImageTarget gameobject is not destroyed... Is there a way to also reference the containing gameobject of the image target? 

UDT keep track of trackable to delete or replace

May 30, 2013 - 3:45pm #2

You can iterate through the trackables as such..

 

            IEnumerable<Trackable> trackables = mBuiltDataSet.GetTrackables();
            Trackable oldest = null;
            foreach (Trackable trackable in trackables){
				
			    ImageTarget it = (ImageTarget) trackable;
				Debug.Log( it.GetSize() );
	
                if (oldest == null || trackable.ID < oldest.ID)
                    oldest = trackable;
				
			}

 

How would you identify that they are capturing the target at a poor angle?

Log in or register to post comments