Log in or register to post comments

Vurforia Rotation Bug

July 26, 2018 - 9:50am #1

I am encountering a strange problem using Vuforia 7.2.20. It has to do with content instantiating at strange rotational offsets from the target markers. I started with the default multi-target example found in the core samples. Here is the XML file found under StreamingAssets:

<?xml version="1.0" encoding="UTF-8"?>
<QCARConfig>
    <Tracking>
        <ImageTarget name="MarsBox.Top" size="0.076200 0.038100"/>
        <ImageTarget name="MarsBox.Bottom" size="0.076200 0.038100"/>
        <ImageTarget name="MarsBox.Back" size="0.076200 0.101600"/>
        <ImageTarget name="MarsBox.Front" size="0.076200 0.101600"/>
        <ImageTarget name="MarsBox.Right" size="0.038100 0.101600"/>
        <ImageTarget name="MarsBox.Left" size="0.038100 0.101600"/>
        <MultiTarget name="MarsBox">
            <Part name="MarsBox.Left" translation="-0.038100000470876694 0 0" rotation="AD: 0 1 0 -90"/>
            <Part name="MarsBox.Right" translation="0.038100000470876694 0 0" rotation="AD: 0 1 0 90"/>
            <Part name="MarsBox.Front" translation="0 0 0.019050000235438347" rotation="AD: 1 0 0 0"/>
            <Part name="MarsBox.Back" translation="0 0 -0.019050000235438347" rotation="AD: 0 1 0 180"/>
            <Part name="MarsBox.Top" translation="0 0.05079999938607216 0" rotation="AD: 1 0 0 -90"/>
            <Part name="MarsBox.Bottom" translation="0 -0.05079999938607216 0" rotation="AD: 1 0 0 90"/>
        </MultiTarget>
    </Tracking>
</QCARConfig>

This correctly generates the default multi-target shown below and it works as expected at runtime.

https://developer.vuforia.com/sites/default/files/marsbox.JPG" style="height: 338px; width: 400px;">

Next, I replaces the left, right, top, and bottom multi-target parts with my own images at a different translation and scale. The rotations are the same as the default example.

<?xml version="1.0" encoding="UTF-8"?>
<QCARConfig>
    <Tracking>
    <ImageTarget size="0.25 0.25" name="satellite" />
    <ImageTarget size="0.25 0.25" name="solarsystem" />
    <ImageTarget size="0.25 0.25" name="dish" />
    <ImageTarget size="0.25 0.25" name="astronaut" />
    <MultiTarget name="Saturn_MultiTarget">
        <Part name="dish" translation="-0.868455 0 0" rotation="AD: 0 1 0 -90"/>
        <Part name="satellite" translation="0.868455 0 0" rotation="AD: 0 1 0 90"/>
        <Part name="astronaut" translation="0 0.868455 0" rotation="AD: 1 0 0 -90"/>
        <Part name="solarsystem" translation="0 -0.868455 0" rotation="AD: 1 0 0 90"/>
    </MultiTarget>
    </Tracking>
<QCARConfig>

https://developer.vuforia.com/sites/default/files/saturn1.JPG" style="width: 500px; height: 330px;">

This again operates as expected.

https://developer.vuforia.com/sites/default/files/saturn2.JPG" style="width: 500px; height: 270px;">

However, the image targets are rotated at odd angles. For example, the astronaut is upside down and the satellite above is rotated 90 degrees clockwise from the original image.  I have tried fixing this in the XML config file by specifying a secondary rotation:

<Part name="dish" translation="-0.868455 0 0" rotation="AD: 0 1 0 -90; 0 0 1 90"/>
<Part name="satellite" translation="0.868455 0 0" rotation="AD: 0 1 0 90; 0 0 1 -90"/>
<Part name="astronaut" translation="0 0.868455 0" rotation="AD: 1 0 0 -90; 0 0 1 180"/>
<Part name="solarsystem" translation="0 -0.868455 0" rotation="AD: 1 0 0 90"/>

Or by combining both rotations into a single AD as shown here:

<Part name="dish" translation="-0.868455 0 0" rotation="AD: -0.5773503 0.5773503 -0.5773503 240" />
<Part name="satellite" translation="0.868455 0 0" rotation="AD: 0.5773503 0.5773503 -0.5773503 120" />
<Part name="astronaut" translation="0 0.868455 0" rotation="AD: 0 0.7071068 -0.7071068 180" />
<Part name="solarsystem" translation="0 -0.868455 0" rotation="AD: -1 0 0 270" />

In both cases the markers appear correct in the editor:

https://developer.vuforia.com/sites/default/files/saturn3.JPG" style="width: 500px; height: 303px;">

However, at run time the AR content is instantiated at an incorrect rotation relative to the marker:

https://developer.vuforia.com/sites/default/files/saturn4.JPG" style="width: 500px; height: 312px;">

Am I doing something wrong or is this a bug with Vuforia?

Log in or register to post comments