Log in or register to post comments

user defined targets and scene objects scale

May 16, 2013 - 1:04am #1

how does the user defined target (always a square image target) scale the scene object? 

user defined targets and scene objects scale

May 17, 2013 - 1:49am #2

Hi, it scales like any other Unity game object;

the size of the target can be retrieved using the Trackable.GetSize() method;

when the user defined target is created, the size is specified in the UserDefinedTargetEventHandler, in this method:

 

private void BuildNewTarget()
    {
        // create the name of the next target.
        // the TrackableName of the original, linked ImageTargetBehaviour is extended with a continuous number to ensure unique names
        mCurrentTargetName = string.Format("{0}-{1}", ImageTargetTemplate.TrackableName, mTargetCounter);
 
        // generate a new target name:
        Debug.Log("ImageTargetBuilder.Build with target name " + mCurrentTargetName);
 
        mTargetBuildingBehaviour.BuildNewTarget(mCurrentTargetName, ImageTargetTemplate.GetSize().x);
    }
 
See the UDT sample.
Log in or register to post comments