SONY

Track the users eye position and apply to a 3D object in Unreal Engine.

This page describes how to track the users eye position and apply to a 3D object to follow the user’s movements on the Spatial Reality Display in Unreal Engine Blueprint.
Here is a sample app for you to try.

  1. Setup your Spatial Reality Display, if not, see: Setup Spatial Reality Display and Setup Spatial Reality Display Settings.
  2. Epic Games Launcher and Unreal Engine are installed.
  1. Create a new Unreal Engine project using a Spatial Reality Display Template as a reference here.

  2. Add new Blueprint. Select “Actor” as the parent class.

  3. Open Viewport of Blueprint created in step 2, put the circle and cylinder, and make the character.

  4. Click on Event Graph, add nodes to create the graph as shown in the image.

  5. Put Blueprint you created on Level and adjust its size, position, and orientation.

  6. When you run the project in VR Preview, the character will turn its head to match the position of your face.

The position of the face is obtained using the node in the red frame in the image.
  1. Enumerate Tracked Devices

    You can get the connected XR devices.
    In this case, we are using it to get XRDevice id of Spatial Reality Display.

  2. Get Device Pose

    You can get the position of the XR device specified by XRDevice id.
    In this case, we are using it to get the position of the face.