Please Select Your Location
Australia
Österreich
België
Canada
Canada - Français
中国
Česká republika
Denmark
Deutschland
France
HongKong
Iceland
Ireland
Italia
日本
Korea
Latvija
Lietuva
Lëtzebuerg
Malta
المملكة العربية السعودية (Arabic)
Nederland
New Zealand
Norge
Polska
Portugal
Russia
Saudi Arabia
Southeast Asia
España
Suisse
Suomi
Sverige
台灣
Ukraine
United Kingdom
United States
Please Select Your Location
België
Česká republika
Denmark
Iceland
Ireland
Italia
Latvija
Lietuva
Lëtzebuerg
Malta
Nederland
Norge
Polska
Portugal
España
Suisse
Suomi
Sverige

Eye Tracking – Migrating from VIVE Pro Eye to Focus 3 using Unity and OpenXR


What will you learn?

You will learn how to migrate your eye tracking project from VIVE Pro Eye to Focus 3 using OpenXR and Unity.

Note:
In this tutorial we will use Unity 2021.3.9f1 and VIVE Focus 3.

Project Settings

  1. In Unity, switch build target to Android.
EyeTracking_Wave_Migration_Unity1.png

  1. Install the latest version of VIVE OpenXR Plugin – Android.
EyeTracking_OpenXR_Migration_Unity1.png

  1. Go to Edit > Project Settings > XR Plug-in Management and enable OpenXR and VIVE Focus 3 Support feature group.
EyeTracking_OpenXR_Migration_Unity2.png

  1. Go to Edit > Project Settings > XR Plug-in Management > OpenXR and add the Eye Gaze Interaction profile.
EyeTracking_OpenXR_Migration_Unity3.png

  1. Add this line to the AndroidManifest:
<uses-feature android:name="wave.feature.eyetracking" android:required="true" />


Setup Scene

  1. Add the Eye Gaze (OpenXR) binding to your input actions asset.
EyeTracking_OpenXR_Migration_Unity4.png
EyeTracking_OpenXR_Migration_Unity5.png

  1. Create a script to utilize the data.
using UnityEngine;
using UnityEngine.InputSystem;

public class EyeGazeTest : MonoBehaviour
{
  [SerializeField] private InputActionAsset actionAsset;
    [SerializeField] private InputActionReference eyePose;

  private void OnEnable()
  {
      if (actionAsset != null)
      {
          actionAsset.Enable();
      }
    }

  private void Update()
  {
      UnityEngine.XR.OpenXR.Input.Pose pose = 
          eyePose.action.ReadValue<UnityEngine.XR.OpenXR.Input.Pose>();
      Debug.Log($"Position: {pose.position} Rotation: {pose.rotation}");
  }
}
  1. Add the references for the Input Action Asset and Input Action Reference.
EyeTracking_OpenXR_Migration_Unity6.png