Marker Tracking

Getting Started

The AR marker tracking feature is spread across several scripts that support multiple XR devices.

The best way to get started in an existing project is to import the Marker Tracking sample via Window > Package Manager > MeshMap XR > Samples.

Or, download one of our example projects that put marker tracking to use in location-based AR games and experiences.

Components

Core

Class
Description

Platform-agnostic marker detection service used by the front-end. Implementations must provide marker poses for a known set of marker IDs.

Device-specific

Magic Leap 2

Class
Description

Implements IPlatformMarkerService for Magic Leap 2.

Meta Quest 3

Class
Description

Implements IPlatformMarkerService for Meta Quest 3.

Frontend

Class
Description

Pairs a fiducial marker's encoded ID (e.g., 0) with the GameObject that represents its pose and visual.

Pairs a fiducial marker's encoded ID (e.g., 0) with the GameObject that localizes to its position.

Defines the orientation of a tracked marker relative to the environment. Flat or Upright.

UI controller for managing the marker localization process, including progress panels, user input toggles, and orientation selection.

Controls marker tracking and content localization. Handles marker detection, content activation, and user-driven localization flow.

Represents the original position and rotation of a transform. Used to store and restore the initial state of objects during localization.

Calibration

Class
Description

Provides UI controls for adjusting positional and rotational calibration values, and resetting to a predefined state. Also allows toggling visibility of position controls.

Manages calibration adjustments for localized AR content. Provides methods to manipulate position and rotation offsets and broadcasts changes via events.

Displays real-time calibration offset values in the UI for position and rotation.

Dependency Injection

Class
Description

Configures the dependency injection container for marker tracking components. Registers relevant components found in the scene hierarchy for injection.

Prefabs

  • Marker Tracker — Ready-to-use prefab with all marker tracking, calibration, dependency injection, and a simple UI preconfigured.

  • Marker Sheet — Visual model for fiduciary markers. Includes a blank version and an AprilTag0 version in A4 and letter size. Adding the visuals in scene makes it easier to validate the tracking accuracy.

  • Calibration Tutorial — Demonstrates how to calibrate the marker tracking results. Miniature so it is easier to understand the spatial relationship between GameObjects and the physical environment.

Last updated