> For the complete documentation index, see [llms.txt](https://help.imotions.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.imotions.com/lab/study-setup-and-design/virtual-reality/htc-focus-vision/htc-focus-vision-setup-guide-for-360-stimuli.md).

# HTC Focus Vision - Setup Guide for 360 Stimuli

Build a Unity APK that plays 360 video with eye tracking on the HTC VIVE Focus Vision, record on the headset and import the recordings into iMotions Lab.

*This article provides a step-by-step guide on creating a 360 stimuli Unity environment for the HTC VIVE Focus Vision. The guide includes information on all the necessary steps and prerequisites for getting started with 360 stimuli and eye tracking.*

### Prerequisites

* **Install Unity Hub:** Install Unity Hub from [here](https://docs.unity.com/en-us/hub/install-hub). The iMotions Unity plugin supports Unity 6 and Unity 2022.3, and has been tested on Unity 6000.6.9f1 and 2022.3.40f1. Install one of these versions through Unity Hub, or download it from the [Unity Archive](https://unity.com/releases/editor/archive).
* **VIVE Developer Setup:** Put on your VIVE Focus Vision, go to **Settings > General > About**, and click on the **Build Number** 7 times to enable Developer Mode. Ensure you have also installed the VIVE Hub or VIVE Manager app if you need to manage device settings externally.
* **Download SideQuest:** Download the SideQuest Desktop app to be able to load the Unity APK files onto the headset. You can download the app from here, [SideQuest](https://sidequestvr.com/setup-howto)
* **AVPro Capture Asset:** Make sure to purchase the full version of the AVPro Capture asset if you do not wish to use the trial version, which has a floating watermark on your environment at all times. The purchase removes this watermark permanently. This is used to capture the VR recording and is required. Purchase from here [AVPro Movie Capture - Mobile](https://assetstore.unity.com/packages/tools/video/avpro-movie-capture-mobile-edition-221852) (Make sure it's the mobile version)
* **Download the iMotions Unity Plugin:** Download the iMotions Vive Unity plugin from [here](https://github.com/imotions/iMotions-UnityPlugin/tree/vive-no-watermark)

## Video guide on setting up a Unity project with 360 video APK file

This video guides you through the entire process of setting up the project and creating the 360 video APK file. Make sure to have installed and completed all prerequisites first. (This guide uses the Unity Plugin with URL. Go to Unity Project Setup 4. for importing with a package)

{% embed url="<https://files.imotions.com/hc_articles/videos/htc-focus-vision.mp4>" %}

### Written instructions Unity Project Setup - Creating the project and setting everything up within Unity

1. Inside Unity Hub, create a new project using Unity 6 (6000.6.9f1) or 2022.3.40f1.
2. Make sure to add Android build support under Installs → Manage → Add modules and check on the Android build support
3. Go to Window → Package Manager and click on the + icon in the top left corner.
4. Choose Add package from disk and navigate into your saved iMotions Unity Plugin folder.

   > If you plan on using the trial version of the AVPro capture asset, make sure you import the package using URL instead of from disk inside of Unity. Paste the following URL when asked: <https://github.com/imotions/iMotions-UnityPlugin.git#vive> (The trial version has a floating watermark)
   >
   > Make sure to install Git first: [Git](https://git-scm.com/install/)
5. Click into the folder and select the `package.json` file to import it. Make sure to also import the samples from the plugin tab. **(Skip if you installed the Unity Plugin using URL)**
6. Once complete, go back to Window → Package Manager, locate the full AVPro Movie Capture asset (under *Packages: My Assets*), and import it into Unity **(Skip if you installed the Unity Plugin using URL).**
7. At the top of your project window, click on VIVE → OpenXR installer and then click on “Install or Update latest version.”
8. Click on File at the top left corner → Build settings → Click on the Android icon → then click on switch platform

#### Android build settings

Go to Edit → Project Settings → Player → Other settings

1. Under Rendering → Color Space → Linear
2. Under Rendering, uncheck or make sure Auto Graphics APIs is off → Move OpenGLES3 so it’s placed as the first option.
3. Under Identification → Minimum API level → Set it to Android 7.0 “Nougat” (API level 24)
4. Under Configuration →
   1. → Scripting Backend → IL2CPP
   2. → Target Architectures → ARM64

#### XR Plugin settings

1. Go to Edit → project settings → XR Plug-in Management
   1. Make sure that Open XR and VIVE XR Support feature group is checked on
2. Click on OpenXR under XR Plug-in Management
3. Make sure VIVE XR Support is enabled
4. Under OpenXR Feature groups, choose VIVE XR Support
5. Make sure VIVE XR Eye Tracker is checked on
6. Make sure that VIVE XR support is checked on
7. At the top, under “Enabled Interaction Profiles,” Click on the + and make sure Eye gaze Interaction Profile is chosen
8. In the same location, make sure that VIVE Focus 3 Controller Interaction is also chosen

***

### Creating a Unity APK file for 360 Stimuli

1. In the Project window, navigate to **Assets → Scenes**.
2. Open the `SampleScene` and rename it to `ThreeSixtyVideo`.
3. Navigate to the iMotions sample scenes folder (e.g., `Samples → iMotions VIVE Plugin → [Version] → EyeTracking Data Export Example → Scenes`) and open that SampleScene.
4. Copy the iMotions-Systems-Vive and XR Origin (XR Rig) objects by highlighting them and pressing Ctrl+C.
5. Go back to your `ThreeSixtyVideo` scene and paste them in.
6. On the left-hand side, click into the XR Origin (XR Rig) object, then click into Camera Offset, and then select Main Camera
7. In the Inspector on the right side, look under Camera and locate the “Clear flags” option.
8. For the “Clear Flags” options, change it from solid color to SkyBox
9. Click into the iMotions-System-VIVE object and locate the VideoCapture object. **(Ignore if you imported the Unity plugin using URL)**
10. Click Add Component and choose AVPro Movie Capture → Capture From Camera. **(Ignore if you imported the Unity plugin using URL)**

***

### How to Make a 360° Video APK

**1. Put the 360 video in Unity**

Create a folder named exactly `StreamingAssets` inside your Assets folder (`Assets/StreamingAssets`). Drag and drop your 360 video file into this folder

Go back to the Assets folder. Follow points 2 and 3 and create the Render Texture and SkyBox material inside this folder

**2. Create the Render Texture (RT\_360)**

Right-click inside of the Assets folder → Create → Render Texture. Name it `RT_360`.

Select it, and in the Inspector, match the Size to your video's resolution (e.g., 4096x2048). Leave the rest as default.

**3. Create a Skybox Material**

Right-click inside of the Assets folder → Create → Material. Name it `Skybox360`.

In the Inspector:

* Change Shader to Skybox/Panoramic.
* Mapping → Latitude-Longitude Layout.
* Image Type → 360.
* 3D Layout → (Depends on your specific video file).
* Drag and drop your RT\_360 object into the Spherical (HDR) slot

**4. Set up the Video Player**

Create an Empty GameObject in the Hierarchy and name it `VideoPlayer`.

Add a Video Player component to it and set the following:

* Render Mode → Render Texture
* Target Texture → Drag in `RT_360`
* Loop → Enable
* Wait For First Frame → Enable
* Play On Awake → Enable

**5. Add the Script**

Click Add Component on the VideoPlayer, select New Script, and name it `VideoPlayer360` Open the script and replace the contents with the following C# code:

C#

```
using UnityEngine;
using UnityEngine.Video;
using System.IO;
public class Play360FromStreamingAssets : MonoBehaviour
{
    [SerializeField] VideoPlayer player;
    [SerializeField] string fileName = "my360.mp4"; // Ensure this matches your video name
    void Awake()
    {
        if (!player) player = GetComponent<VideoPlayer>();
        player.source = VideoSource.Url;
        string path = Path.Combine(Application.streamingAssetsPath, fileName);
        player.url = path;
        player.waitForFirstFrame = true;
        player.playOnAwake = true;
        player.isLooping = true;
    }
    void Start()
    {
        player.Play();
    }
}
```

*Note: In the Inspector, drag the Video Player component into the* `player` *field and ensure the* `fileName` *string exactly matches your file in StreamingAssets.*

**6. Assign the Skybox**

Go to Window → Rendering → Lighting → Environment. Drag your `Skybox360` material into the Skybox Material slot.

Make sure that the 360 project can be played inside of Unity

### Build the APK file

*Make sure that the environment can be played inside Unity*

1. Click on File in the top left corner and choose Build Settings
2. Click on Add Open Scene and make sure it's the ThreeSixtyVideo Scene
3. Click on Build and save the APK somewhere safe

### Loading the APK onto the VIVE Focus Vision

1. Open SideQuest on your PC.
2. Connect your VIVE Focus Vision via a USB-C to USB-A cable. Ensure you click "Allow USB Debugging" inside the headset if prompted.
3. Verify SideQuest shows a green connection dot in the top left corner.
4. Click the "Install APK file from folder on computer" icon (box with a downward arrow) in the top right. Select your built APK.
5. Put on the headset. Open your App Library, select the filter dropdown (usually top right), and select Unknown Sources to find and launch your Unity app.

### Capturing, Recording, and Saving the Data

1. Once the environment is running on the VIVE Focus Vision, you can start recording by clicking the **Grip Button** on your right controller (the button that rests under your middle finger).

   ![](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-9fa1f147d9fdd837c573e7bb7724a1bfcba97e68%2F26a03ef218_image-UY2MAKTI.webp?alt=media)
2. To end the recording, click the Grip Button again. This saves the screen recording and the CSV eye-tracking data.
3. To retrieve the data, plug the headset back into your PC and open SideQuest.
4. Click the "Manage Files on the headset" icon (folder icon) in the top right.
5. Navigate to: `Android → Data → [Your Unity Project Name] → Files → iMotions`.
6. Click the floppy disk save icon next to the folder to download the data to your PC.

### Loading the APK into the headset and exporting the recordings

This video guide shows you how to load the APK file onto the headset using SideQuest and how to extract the recordings afterwards

{% embed url="<https://files.imotions.com/hc_articles/videos/tutorial2final.mp4>" %}

### Importing recordings into iMotions

Once you have saved the recording folder to the PC, do the following:

1. Inside of iMotions, click on the blue “create new study” Icon
2. Choose “Virtual Reality (VR)”
3. Choose “Import VR Recordings”
4. Select the “HTC VIVE Focus Vision”
5. New study and import the recordings folder.

When you import the recording, make sure to place the study files folder containing the capture video and the CSV file inside an import folder so it looks like this: ![](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-885d937ccb3dc75d575083c4a56ea47b75100731%2F10bff25f01_image-Q28B5VNV.webp?alt=media)

You will need to choose the Import folder to import:

![The dialog for importing HTC VIVE Focus Vision data, with the data folder filled in](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-fd198fd767f8af3a6ad85c5691256535beb58a89%2Flab_import_htc-vive-focus-vision-data-folder.png?alt=media)

> It’s important to ensure that the Eye Tracking data file is formatted correctly. The decimal separator needs to be a dot, and not a comma.
>
> <img src="https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-0bfd11839c6650f0598e1a625c71cf3e31476590%2F79438fd384_image-WIKPAN2W.png?alt=media" alt="" data-size="original">


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.imotions.com/lab/study-setup-and-design/virtual-reality/htc-focus-vision/htc-focus-vision-setup-guide-for-360-stimuli.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
