Now that you've mastered 3DOF rotational tracking and controller interactions, it's time to move on to marker tracking! Our native tracking library is powered by Wikitude, and it allows you to anchor virtual objects to the surface of the physical object.
Drag the MiraWikiTracking prefab from MiraSDK->Prefabs into a new Scene.
The Wikitude Tracking prefab object differs from the Rotational Tracking prefab in two ways:
a. MiraWikitudeManager: This script initializes the WikitudeCamera which uses the device's camera to track physical images. It also mages the handoff between tracking states.
b. Mira Tracker: It uses the Image Tracker to call Tracking Found and lost events and the Image Trackable component contains a list of images to be tracked.
All gameobjects depending on Image Tracking for 6DOF experience should be child of the Trackers->MiraTracker gameobject,.(The Trackers gameobject should be attached to MiraWikiManager->ImageTracker).
All other gameobjects not parented to the tracker should be a child of the HeadOrientation gameObject.
While creating your scenes make sure to have a similar Hierarchy setup as below
- The MiraARCamera must have the components shown in the image below :
- Add a desired 3D model under Trackers->MiraTracker, it will be displayed on the physical Image Tracker, when tracked by the device camera.
Adding Custom Trackers
You can add custom Images for tracking in Window->WTCEditor and select the file on the ImageTrackable on MiraTrackers gameobject.
Make sure to input the tracker size in mm in WTCEditor for physically-correct scaling.
- Attach 3D objects which do not depend on Tracking under Head Orientation, like any environment components and 3D UI.
3.. You can add custom effects and animations on the model and synchronize it with the tracking events and head orientation, for eg. attach the MarkerRotationalWatcher and TrackerLerpDriver scripts on the 3D model.
You will notice GameObject moving along the y-axis on spinning the tracker.
- Follow the default Build Process to test your experience.
Tracking in Unity Editor
Currently we do not support image tracking in unity editor mode.
MiraEditorPreview script can be attached to simulate between various tracking states.