Log in or register to post comments

Orientation in Multitarget specified in the Xml file

October 10, 2012 - 3:12am #1

Hi Guys,

i read on the documentation:

"Multiple rotations can be added consecutively after each other in order to execute combined rotations. To add multiple rotations to the definition, separate the rotation instructions with a semicolon:

<Part name="myPart" translation="10 0 0" rotation="AD: 1 0 0 90; 0 1 0 -90" />"

 

Can you explain me in which order the rotations are applied (left-to-right or right-to-left) and respect which coordinate system (local/absolute)?

Thank You 

Orientation in Multitarget specified in the Xml file

October 15, 2012 - 3:33am #7

Hi Andrea,

I tried to reproduce your issue by concatenating two rotations in the XML file of the MultiTarget sample;

my test is rotating the Front part of the FlakesBox by 45 degrees around the Z axis and then by 45 degrees around the X axis

(by the way, I also made other similar tests with various angles); here is how I changed the XML: 

<Part name="FlakesBox.Front" translation="0 0 30" rotation="AD: 0 0 1 45; 1 0 0 45"/>

From the tests I have run, I did not see any wierd behavior with that; the wireframe looks rotated pretty much as expected with respect to the real box.

Could you do the same test to see if you notice any issue ? (please use the MT sample without any modification except the one above, just to  be sure to exclude other factors in the test).

Btw, which version of Vuforia are you running ? I did the tests with 1.5.9 (as downloaded from public website)

 

Orientation in Multitarget specified in the Xml file

October 12, 2012 - 7:15am #6

Yes exactly. this is part how i do the calculations offline:

res = av_vector(((matrix) av1) * ((matrix) av2));

av_vector is the class containing the axis-angle description, matrix is a class for matrices.

i write the result on the xml.

if i write av1; av2 on the xml it seems not giving me the same result.

Thank you again,

Andrea

Orientation in Multitarget specified in the Xml file

October 12, 2012 - 7:06am #5

Thank you for sharing this with us Andrea.

so, if I understand well, you compute the matrix multiplication "offline" (i.e. on your own), then you convert the resulting matrix back into axis-angle and finally you enter the resulting axis angle into the MultiTarget XML to specify the part orientation; is that a correct understanding ?

 I will take a look to check any issues with actual behaviour.

Thanks again for sharing your findings. 

Orientation in Multitarget specified in the Xml file

October 12, 2012 - 6:55am #4

Thanks Alessandro for your reply,

it's clear what you said, as you teach me matrix multiplication is not commutative, hence the order of the performed operation is important, and that's why i asked my question. Unfortunately, i transformed my 2 axis angle rotations into matrices, performed the multiplication, and converted the resulting matrix back into axis angle form. In that way, my object is perfectly positioned into the space. writing the rotations with the order you suggested, instead, lead to an incorrect position of the object in the space and flickering. So for now i will use my axis angle calculations.

A.

Orientation in Multitarget specified in the Xml file

October 12, 2012 - 6:55am #3

Thanks Alessandro for your reply,

it's clear what you said, as you teach me matrix multiplication is not commutative, hence the order of the performed operation is important, and that's why i asked my question. Unfortunately, i transformed my 2 axis angle rotations into matrices, performed the multiplication, and converted the resulting matrix back into axis angle form. In that way, my object is perfectly positioned into the space. writing the rotations with the order you suggested, instead, lead to an incorrect position of the object in the space and flickering. So for now i will use my axis angle calculations.

A.

Orientation in Multitarget specified in the Xml file

October 10, 2012 - 3:44am #2

Hi Andrea, this is how it works:

rotations are combined left-to-right (i.e. in the same order as you specify them in the XML); so, if you have N rotations separated by semi-colon, the left-most one is executed first, the right-most is executed last.

Every rotation is concatenated on top of the previous one, so the reference is always local (i.e. if the first rotation rotates the part reference by 90 degrees around Z axis, then the second rotation will be applied on top of the rotated reference, where basically the X and Y axis have been rotated 90 degrees around Z with respect to the initial frame);

mathematically you can think of each rotation as adding a matrix multiplication.

 

Log in or register to post comments