|
1 | | -#Basic MRTK Setup to use Eye Tracking |
2 | | -This page covers how to set up your Unity MRTK scene to use Eye Tracking in your app. |
3 | | -The following assumes you’re starting out with a fresh new scene. |
| 1 | +# Eye Tracking Examples in MRTK |
| 2 | +This page covers how to get quickly started with using Eye Tracking in MRTK by building on our provided MRTK example package. |
4 | 3 |
|
5 | | - |
6 | | -### Setting up the Scene |
7 | | -Set up the MixedRealityToolkit by simply clicking *'Mixed Reality Toolkit -> Configure…'* in the menu bar. |
8 | | - |
9 | | - |
10 | | - |
11 | | - |
12 | | - |
13 | | -### Setting up the MRTK Profiles |
14 | | -After setting up your MRTK scene, you will be asked to choose a profile for MRTK. |
15 | | -You can simply select the default one ( *DefaultMixedRealityToolkitConfigurationProfile* ) and then select the *'Copy & Customize'* option. |
16 | | - |
17 | | - |
18 | | - |
19 | | - |
20 | | - |
21 | | -### Create an "Eye Gaze Data Provider" |
22 | | -- Navigate to the *'Extension Services'* |
23 | | - |
24 | | -- To edit the default one ( *DefaultMixedRealityRegisteredServiceProvidersProfile* ), click the *'Clone'* button next to it. |
25 | | - |
26 | | -- Create an *Eye Tracking Service Provider* (the precise name is not important) by clicking *'+ Register a new Service Provider'* |
27 | | - |
28 | | - - **Component Name:** |
29 | | -Name your service provider to remember it better in the future (e.g., Eye Tracking Service Provider) |
30 | | - |
31 | | - - **Component Type:** Select *'Microsoft.MixedReality.Toolkit.WindowsMixedReality.Input'* -> *'WindowsMixedRealityEyeGazeDataProvider'* |
32 | | - |
33 | | - |
34 | | - |
35 | | - |
36 | | - |
37 | | - |
38 | | -### Enabling Eye Tracking in the GazeProvider |
39 | | -In HoloLens 1, head gaze was used as primary pointing technique. |
40 | | -While head gaze is still available via the *GazeProvider* in MRTK, you can check to use eye gaze instead by ticking the *'Prefer Eye Tracking'* checkbox. |
41 | | - |
42 | | - |
43 | | - |
44 | | - |
45 | | - |
46 | | - |
47 | | -### Simulating Eye Tracking in the Unity Editor |
48 | | -You can simulate Eye Tracking input in the Unity Editor to ensure that events are correctly triggered before deploying the app to your HoloLens 2. |
49 | | -Follow the below steps to use your scene camera's location as eye gaze origin and the camera's forward vector as eye gaze direction. |
50 | | - |
51 | | -1. **Enable simulated Eye Tracking**: |
52 | | - - Navigate to *MRTK Configuration Profile* -> *Additional Service Providers* -> *In-Editor Input Simulation*. |
53 | | - - Check the *'Simulate Eye Position'* checkbox. |
54 | | - |
55 | | - |
56 | | -2. **Disable head gaze cursor**: In general, we recommend not to show an eye gaze cursor or if you do to make it *very* subtle. |
57 | | - - Navigate to *MRTK Configuration Profile* -> *Input System Profile* -> *PointerSettings.PointerProfile* |
58 | | - - At the bottom of the *PointerProfile*, you should assign an invisible cursor prefab to the *GazeCursor*. |
59 | | - |
60 | | - |
61 | | - |
62 | | -### Accessing eye gaze data |
63 | | -Now that your scene is set up to use Eye Tracking, let's take a look at how to access it in your scripts: |
64 | | -[Accessing Eye Tracking Data in your Unity Script](/Documentation/EyeTracking/EyeTracking_EyeGazeProvider.md). |
65 | | - |
66 | | - |
67 | | -### Building the Unity app for your device |
68 | | -The *'Gaze Input'* capability is unfortunately not yet supported under 'Player Settings -> Publishing Settings -> Capabilities' in Unity. |
69 | | -To use Eye Tracking on your HoloLens 2 device, you need to manually edit the package manifest. |
70 | | -First, build your Unity project as you would normally do. |
71 | | -Open your compiled Visual Studio project and then open the `Package.appxmanifest` in your solution (see screenshot below). |
72 | | -Make sure to tick the *'Gaze Input'* checkbox under *Capabilities*. |
73 | | - |
74 | | - |
| 4 | +<!-- TODO: Add more infos -- > |
75 | 5 |
|
76 | 6 | --- |
77 | 7 | [Back to "Eye Tracking in the MixedRealityToolkit"](/Documentation/EyeTracking/EyeTracking_Main.md) |
0 commit comments