Reputation: 29
I have just started developing with Unity3D and Vuforia to create augmented reality applications. I was wondering if anyone has tried or seen examples of a single augmented object e.g. a cube being generated when several markers are detected.
The idea would be to place 3 AR Markers in a triangular shape and when all 3 are detected draw a cube in the middle. Most projects I have seen seem to use a single marker corresponding to a single object. The idea here is that all 3 markers would be required to draw the object.
Any help or pointers in the right direction would be greatly appreciated.
Thanks
Upvotes: 1
Views: 3747
Reputation: 10701
You should look at this page https://developer.vuforia.com/forum/faq/how-many-targets-can-i-track-vuforia. You can track many marker at once using the max simulataneous tracking in QCARBehaviour but it will depend on your hardware.
Once you get to track them all three, each marker is a game object with target tracking component, each of the object will receive the event:
public void OnTrackableStateChanged(TrackableBehaviour.Status previousStatus, TrackableBehaviour.Status newStatus)
{
if(newStatus == TrackableBehaviour.Status.DETECTED || newStatus == TrackableBehaviour.Status.TRACKED || newStatus == TrackableBehaviour.Status.EXTENDED_TRACKED)
{
OnTrackingFound();
}
else
{
OnTrackingLost();
}
}
from the ITrackableEventHandler interface. You can then implement OnTrackingFound/Lost as you need.
In your case, a controller would listen to the events from all three trackers and when all three are on, it displays item.
Upvotes: 1