What do you need help with?

Proper Scaling in Vuforia Target Manager and Unity

Follow

We wanted to share this information, as we ourselves have encountered this issue, and it was tricky to resolve. See the following post from Vuforia on how to properly scale content:
https://developer.vuforia.com/library/articles/Solution/How-To-Scale-and-Position-Content-Using-OpenGL

In short Vuforia Target manger creates the target data in millimeters.  So when uploading a target you have to specify the target size in millimeters. If developers are using native android for their application see the link above for proper scaling. They don’t have to convert the downloaded xml data since Vuforia Target manager is already in openGL scene units.
If developers are using Unity they have to convert the xml file imported in their project to Unity scene units, which is in meters.


Under StreamingAssets/QCAR/ [xml file name]


Edit that file and convert the millimeters number to meters. Basically divide by 1000. So as a example the following is what is returned by TargetManager :


<?xml version=”1.0″ encoding=”UTF-8″?>
<QCARConfig xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:noNamespaceSchemaLocation=“qcar_config.xsd”>
<Tracking>
<ImageTarget name=”medical” size=”247 139″ />
<ImageTarget name=”garage” size=”247 139″ />
<ImageTarget name=”game” size=”247 138″ />
<ImageTarget name=”contruction” size=”247 125″ />
</Tracking>
</QCARConfig>


In Unity it should be like the following :


<?xml version=”1.0″ encoding=”UTF-8″?>
<QCARConfig xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:noNamespaceSchemaLocation=”qcar_config.xsd”>
<Tracking>
<ImageTarget name=”medical” size=”.247 .139″ />
<ImageTarget name=”garage” size=”.247 .139″ />
<ImageTarget name=”game” size=”.247 .138″ />
<ImageTarget name=”contruction” size=”.247 .125″ />
</Tracking>
</QCARConfig>

Have more questions? Submit a request

Comments

Powered by Zendesk