The Oculus Tracker is an infrared camera that tracks the position of the Oculus Rift and Oculus Touch devices relative to it’s own location.
It can be quite handy to be able to display the location of the camera within an app or game to help the player orient themselves, or even just to give the player a physical reference in their real space.
Locating the Oculus Tracker
The Oculus Unity Utilities provides several ways to locate the position of the tracker.
One way is to programmatically call OVRManager.tracker.GetPose() and OVRManager.tracker.GetFrustum().
But, since Oculus Unity Utilities 1.3.2 onwards, the OVRCameraRig prefab has a new anchor under the TrackingSpace called TrackerAnchor.
Simply place a 3d model of the tracker under this anchor and it will be positioned automatically at the correct location and orientation.
Displaying a 3d model
Here is a simple 3d model prefab of the Oculus Tracker. You can download it at the bottom of this post:
Simply drag the model prefab onto the TrackerAnchor:
As shown below, the tracker model reflects the physical orientation (thanks to its on board accelerometer sensor):
Unity Demo Scene
Download the tracker model (and demo scene) here:
TrackerDemo.unitypackageNote: Please create a new Unity project and import the Oculus Unity Utilities v1.5 then import the tracker above.
Leave a Reply