Log in or register to post comments

Setting Max Simultaneous Image Targets Dynamically

June 20, 2014 - 8:55am #1

Hi,

Just wondering if it is possible to set the Max Simultaneous Image Target dynamically in Unity using code? Sorry if this topic has been covered before, but I have searched everywhere and couldn't seem to find an answer. Thanks so much!

Setting Max Simultaneous Image Targets Dynamically

March 2, 2015 - 11:54am #7

Excellent! Thanks, Alessandro.  That helped me see that I need to add using Vuforia, and it also showed that I needed to add QCARUnity. to the argument, which is slightly different then the code below in the thread and also different what is shown here .   Now I can compile with no trouble and it works just fine.   I was thrown off at first because in the inspector the Max Simultaneous Tracked Images Value on the QCARBehaviour Script does not change.

Setting Max Simultaneous Image Targets Dynamically

March 2, 2015 - 8:32am #6

In Vuforia 4.0, you may have to add this line at the top:

using Vuforia;

(unless you're already in the Vuforia namespace).

The correct code then becomes:

QCARUnity.SetHint ( QCARUnity.QCARHint.HINT_MAX_SIMULTANEOUS_IMAGE_TARGETS );

 

Setting Max Simultaneous Image Targets Dynamically

March 2, 2015 - 7:35am #5

Hey Guys - This is my first post on the forum.  I'm really excited about using Vuforia - it's an extremely impressive product.
After searching the forums I haven't been able to figure out this response.  I too would like to be able to dynamically change the simultaneous image targets.  However, I'm uncertain where to use QCARUnity.SetHint ( QCARHint.HINT_MAX_SIMULTANEOUS_IMAGE_TARGETS,  2 ); in a script, and if the script needs to be setup in a special way.   I've tried to use it in DefaultTrackableEventHandle but I get the error " The name "`QCARHint' does not exist in the current context" .  I imagine I'm missing something simple, but I think the answer might be useful others as well. 

Thanks in advance for any insights!  Requisite apologizes for newness. 

-Aaron 

Setting Max Simultaneous Image Targets Dynamically

June 24, 2014 - 2:13am #4

Thanks so much! I'll give it a try

Setting Max Simultaneous Image Targets Dynamically

June 24, 2014 - 12:05am #3

You can set the number of max simultaneous targets programmatically using this API:

QCARUnity.SetHint ( QCARHint.HINT_MAX_SIMULTANEOUS_IMAGE_TARGETS,  2 );

as explained in this FAQ:

https://developer.vuforia.com/forum/faq/how-many-targets-can-i-track-vuforia

 

Setting Max Simultaneous Image Targets Dynamically

June 23, 2014 - 8:33pm #2

For Unity, you have to set the option within the Inspector. A look at the QCARAbstractBehaviour class doesn't reveal the field, nor does QCARBehaviour inherit it.

API: https://developer.vuforia.com/resources/api/unity/class_q_c_a_r_abstract_behaviour

Related Thread: https://developer.vuforia.com/forum/qcar-api/how-many-image-targets-can-be-tracked
 

Log in or register to post comments