Log in or register to post comments

Multi target won't work when 'complicated' rotation is used

January 9, 2018 - 12:34am #1

I have been trying to use multi target(I want to track all the 20 sides of a icosahedron) and I didn't succeed. What I see in the scene of the Unity editor and what you see in the game is totally different, which is very confusing.

For example, I modified my xml in a way so that in the scene of the Unity editor, the image target is perfectly aligned with my final object. But when I hit play, they are not.

After so many trail and errors, I finally concluded that the above error would appear when you are using a complicated rotation, for example:

Part name="examplemarker" translation="0 0 0" rotation="AD: 0.3911556 0.2607704 -0.8826076 200"

If you just rotate along the x axis(or y, or z), it would work just fine, for example:

Part name="examplemarker" translation="0 0 0" rotation="AD: 0 1 0 153.645645"

You can recreate this and visualize the error easily.

 

Normally, vuforia would render the marker as a mask, which means that the virtual object behind the marker cannot be seen. Normally, the mask would align with the actual marker in the camera video view perfectly, but when a complicated rotation is used, the mask is not aligned with the actual marker in the camera!!

I really hope Vuforia can fix this or state this in the official documentation.

It you use quaternion in the XML, the rotation in XML won't be recognized in the editor but would appear exactly the same with an axis-angle rotation during runtime, both in the editor or on Android.

 

I have been trying to create the multi target for nearly two months. Would really appreciate some help!

Multi target won't work when 'complicated' rotation is used

January 21, 2018 - 11:09pm #4

Hi dpizzle,

 

Thank you so much for replying to my thread! I am so sorry that I didn't reply to you earlier. I thought that no one would ever notice the thread.

Glad that you saw the same issue. And I tried to do this manually as well. The problem is that it would cause a lot of glitching. I think that Vuforia would do some smoothing under the hood. With my implementation, the experience is just too bad to be acceptable, especially compared to the smooth tracking of the cuboid multitarget.

 

Thanks again for your reply.

Multi target won't work when 'complicated' rotation is used

January 9, 2018 - 4:53pm #3

I found something in the docs that might help and make it possible after all, see below.  The last line says you can do multiple rotations seperated by semicolon.  Also if you disregard the AD it looks like you can use Quaternions, that might help as well.  Good luck.

-------------------------

maxLength(size) = 255, furthermore must follow one of the formats:

AD: x y z r rotation of r degrees around [x,y,z] vector

AR: x y z r rotation of r radians aroun d [x,y,z] vector

x y z w quaternion rotation with [x,y,z,w]

Multiple consecutive rotations are allowed, separated by semicolon.

Multi target won't work when 'complicated' rotation is used

January 9, 2018 - 3:38pm #2

Hmmm, I see the issue and read the docs.  I think you might be right, that this is not possible with multi targets.  With that said what about doing it manually in code?  If you think about it, multitargets are just multiple simultaneous image targets that have some code under the hood that averages out the translation and rotation values to give a better pose estimation. Here's how'd I do it.  

1. Upload each face as a different image target.

2. Up the number of simultaneous targets in the configuration

3. Position each image target face in unity to form your geometry, add an empty game object as a child to each face, and make sure each child is the center of the isochhdron and rotated the same way.

4. Keep track of all the those dummy gameobjects in code.  Average them together to get better accuracy if you need it. If at least one target is visble show what you need, otherwise don't.





 

Log in or register to post comments