Building blocks for eye tracking in Augmented Reality AR
and Virtual Reality VR
or more generally Head Mounted Displays HMD
.
-
Make sure that you have Pupil Capture or Pupil Service on a Linux, macOS, or Windows 10 machine.
-
Open
Assets/scene/Calibration.unity
with the Unity3d Editor (Unity 5.5 and above). -
Select the PupilGaze GameObject in Unity Hierarchy.
-
Connection
- Local - use this setting if your HMD and your Pupil add-on are connected to the same computer.
- In Unity's Inspector select
Settings>Pupil App>Local
- Click on the Browse button. Navigate to Pupil Service - pupil_service.exe - or Pupil Capture - pupil_capture.exe.
- If you're using Pupil Capture make sure your Service Port matches the Port in Pupil Capture. See the Pupil Remote plugin in Pupil Capture to check.
- In Unity's Inspector select
- Remote - Use the remote mode if your HMD and pupil eye tracking add-on are connected to different computers, but on the same wifi or wired network.
- In Unity's Inspector select
Settings>Pupil App>Remote
- Make sure that your Pupil Capture application is running on the remote machine.
- Take note of the IP address of the active communication device in your remote machine. (Please keep in mind that in some cases the IP address stated in Pupil Capture may not be correct, check the IP address of your system!).
- Copy this IP address to the IP address field in Unity.
- In Unity's Inspector select
- Local - use this setting if your HMD and your Pupil add-on are connected to the same computer.
-
Auto-run Pupil App settings - If auto-run is enabled, Pupil Service will run automatically when your Unity3d scene is in play mode. You can disable this behavior by turning off auto-run in
Settings>Pupil App
and manually Start or Stop Pupil Service. -
Confirm connection - Make sure that the plugin status (below the Pupil Labs logotype) displays the word "connected" and that both of the eye icons are green. The green eye icons signify that the eye processes are running.
- Choose your desired calibration method under
Settings>Calibration
. You can chose 2D or 3D. - Press Play in Unity and wait until you have established a working connection with your Pupil App.
- Calibrate - Give focus to the main Unity3d window and press c on the keyboard or the
Calibrate
button in the plugin GUI. - Put your headset on and look at the center of each marker shown in your HMD. The number of markers varies depending on your calibration mode.
Note: The ideal setup for calibration may vary using different headsets. For optimal calibration results I suggest some experimenting with the hardware settings of your HMD device such as the eye distance from the lens, inter eye distance, a steady mount position.
- 2D
- You can access the 2d gaze point in Unity3d with
GetEyeGaze2D (GazeSource.BothEyes)
.
- You can access the 2d gaze point in Unity3d with
- 3D
Pupil.values.GazePoint3D
Pupil.values.GazeNormals3D
Pupil.values.EyeCenters3D
Chat with the hmd-eyes community on Discord.
Join the google group to discuss ideas and stay updated.