Object Tracking
Introduction to Object Tracking
Object Recognition and Tracking extends the capabilities of the Wikitude SDK to recognize and track arbitrary objects for augmented reality experiences. The feature is based on Wikitude's SLAM engine that is also used for Instant Tracking. Object Tracking let you detect objects, that were pre-defined by you. Suitable objects include
- Toys
- Monuments and statues
- Industrial objects
- Tools
- Household supplies
Object Tracking in Unity
Before proceeding with the Object Tracking sample, please make sure you are familiar with how Image Tracking works first by reading about the Image Tracking samples. Most concepts described there work in a similar way for Object Tracking.
ObjectTracker Prefab
To add a tracker prefab to the scene, simply drag the ObjectTracker
prefab into the scene hierarchy.
An ObjectTracker
itself needs a Wikitude Object Collection (.wto file) which contains information needed to detect the reference objects. Target collections can be generated and downloaded from the Wikitude Target Manager - a free web based tool, that you can access with your developer account. You can use the .wto file in the same way as .wtc files are used for the ImageTracker
.
Recognition events also work exactly like recognition events for the ImageTracker
.
Define custom augmentations
Because an ObjectTracker
can only recognize and track a single object at a time, you can define augmentations either by defining a Drawable
prefab in the ObjectTrackable
, or by placing them directly as child objects to the trackable and enabling Auto Toggle Visibility
.
In the Object Tracking - Object Tracking
scene, the Drawable
prefab workflow is illustrated. A FiretruckAugmentation
prefab was created in the SamplePrefabs
folder and assigned to the ObjectTrackable
. The transform of the prefab has been modified so that the augmentations will match the real object during tracking.
Within the FiretruckAugmentation
prefab you will also find the FiretruckOccluder
GameObject which contains two meshes that are used as occluders. You can read more about occluders and how they work in Unity here