Skip to main content
Version: 12 Dec 2024

Magic Leap OpenXR Samples

The Magic Leap Hub (ML Hub) includes a set of samples that demonstrate some of Magic Leap's device specific features. These samples can be downloaded via ML Hub's Package Manager and then built using Android Studio or a command line interface using the build.py script.

Prerequisites

Sample Applications

  • eye_gaze : Demonstrates how to use the OpenXR XR_EXT_eye_gaze_interaction extension. When looking around you should see where you're looking (a cube will float in air to match the direction of your gaze). Bubbles will float up around you, which you can pop using your gaze.
  • hand_tracking : Demonstrates how to use the OpenXR XR_EXT_hand_tracking extension. When looking at your hands you should see cubes at your finger joints. Bubbles will float up around you which you can pop using your hands.
  • marker_tracking : Demonstrates how to use the OpenXR XR_ML_marker_understanding extension. An imgui dialog with a series of marker tracking settings that can be adjusted and re-applied to a marker detector client. These settings determine what type of marker to track and how we want to profile our marker detector. Detected markers will be displayed at the bottom with the respective data associated with the marker. Currently, only Aruco, QR, and April Tag will have a corresponding rendered cube associated with the marker upon detection.
  • palm_pose : Demonstrates how to use the OpenXR XR_EXT_palm_pose extension. The app draws a simplified hand model to better visualize the palm pose values. Because of the simplicity of the hand meshes a few details have been added to discern if models for both hands have correct poses.
  • plane_detection : Demonstrates how to use the OpenXR XR_EXT_plane_detection extension. An spatial dialog will be visible showing the capabilities of the plane detection system. It will also show a few checkboxes controlling the operating mode of the detection.

Download OpenXR Samples

You can download the OpenXR samples from the Package Manager in ML Hub.

  1. Open the ML Hub 3 and select the Packages option in the left sidebar.
The ML Hub 3 with the Packages option selected.
  1. In the Packages section, select ML C SDK. Click Install.

  2. In the Packages section, select OpenXR Samples. Click Install.

Building the Samples

Before attempting to build the samples, please complete the environment setup steps in Environment Setup. Once your environment is configured, you can build the samples using Android Studio or Command line.