The Live Data in Virtual Reality project developed on Unity is an exciting project created for the class 8810 Eye Tracking II: Gaze Sensing and Interaction in XR at Clemson University in spring-2023. The project aims to combine the latest virtual reality technology to create an immersive and interactive user experience in which users can navigate the environment. Every time the user’s gaze focuses on a specific object, the program will fetch a value (number) transmitted by a Web API representing the actual temperature in a water pump.
HTC VIVE PRO EYE device with all its dependencies (required if you want to see the eye interaction). Setting up VIVE Pro Eye for the first time. You can use your laptop keyboard to interact with the game in case you do not have the HTC VIVE PRO EYE device.
Installation
Open Unity project:
First, open Unity Hub on your computer. If you haven't installed it yet, you can download it from the official Unity website.
Once Unity Hub is open, click on the "Projects" tab located on the left side of the window.
Click on the "Add" button located on the top right corner of the window.
A pop-up window will appear, select "Browse" to find the project folder you want to open.
Select the project folder and click on "Select Folder".
After selecting the project folder, it will appear in the list of projects in Unity Hub.
Select the project from the list, and then click on the "Open" button located at the bottom right corner of the window.
The Unity Editor will launch and open your project.
That's it! Now you can start working on your project in Unity. You will see Unity window like the following image:
Research Log
The following section conveys the record of various activities and processes involved in conducting this research. It provides documentation, observations, and decisions throughout the research process. This section aims to help researchers keep track of the work, ensure consistency, and provide a clear record of the methods and results.
Goals:
Create a VR enviroment in Unity
Compatible with HTC Vive Pro Eye
Dynamic loading of assets
Fetch live data when user watch an object
Publish on GitHub the Project and methods
Budget friendly (preferably)
Low cognitive load (preferably)
Software and Hardware
Why Unity?
Unity Engine software was chosen for this project compared to other software for the following reasons:
Previous knowledge: The developer working on the project has more experience programming in C# language (since 2016) than other programming languages and has already had some experience working in Unity Engine (since 2022).
Easy to use: Unity has a user-friendly interface and a simple learning curve, making it accessible to developers of all skill levels.
Multi-platform support: Unity supports multiple platforms, including Oculus Rift, HTC Vive, PlayStation VR, and Google Cardboard, among others.
Community support: Unity has a large and active community of developers who share their experiences and provide support through online resources.
Built-in VR support: Unity has built-in support for VR, which means that developers can easily create VR applications and experiences without needing to write additional code.
Extensive asset store: Unity's asset store contains a wide range of pre-built assets, including models, animations, and scripts, which can save developers time and effort. This variety of assets is essential to expand the project or simulate specific scenarios.
Performance optimization: Unity offers built-in tools for optimizing VR performance, critical for delivering a smooth and immersive VR experience.
Continuous development: Unity is constantly evolving, with regular updates and new features added, ensuring it remains a cutting-edge engine for VR development.
Why HTC Vive Pro Eye?
This device was chosen for this project compared to other devices for the following reasons:
Device Availability: The device is available for use free of charge in the Clemson University laboratory where the project was carried out.
Eye-tracking technology: The Vive Pro Eye is the first VR headset to feature eye-tracking technology, which allows a more natural interaction, immersive experiences, and the potential for new forms of exchange, such as eye-based navigation and selection.
High-resolution: The Vive Pro Eye has a high-resolution of 1440 x 1600 pixels per eye, which provides a more detailed and precise VR experience (convenient when selling the software).
Developer support: HTC is firmly committed to developer support, offering resources such as the Viveport SDK and the Vive Developer Community to help developers create VR experiences with the Vive Pro Eye.
Unity integration: The Vive Pro Eye is fully integrated with Unity, so developers can easily create VR experiences for the Vive Pro Eye using the Unity engine.
OpenVR support: The Vive Pro Eye is compatible with OpenVR, an open standard for VR development that supports multiple VR devices and engines. Developers can use the Vive Pro Eye with other VR devices and machines if desired.
Data interaction and gaze track
The program has two principal actions:
1. Obtaining the user’s gaze
For the program to identify when the user looks at the object, it was necessary to implement the function “GazeFocusChanged” from the Tobii SDK for Unity. Tobii SDK (Software Development Kit) is a suite of software tools and APIs (Application Programming Interfaces) provided by Tobii AB, which develops eye-tracking technology. The Tobii SDK allows developers to integrate eye-tracking functionality into their applications and games and use eye-gaze data as an input method, among other features.
This information was discussed in the paper by PhD Duchowski, Andrew T. et al., 3D gaze in virtual reality: vergence, calibration, event detection in 2022. It discusses the challenges and opportunities of 3D gaze-tracking technology in virtual reality (VR) environments. It also describes some techniques for calibrating 3D gaze-tracking technology, like using natural features as reference points.
The following content is the code implemented in the project:
When the user’s gaze is watching the object, the program executes an HTTP request to a Web API which transmits a JSON response containing a number done using the class UnityWebRequest. UnityWebRequest is a class in the Unity game engine that allows developers to send HTTP requests and receive responses from web servers. One crucial point is that the program executes the HTTP request in every frame (the execution is controlled using Coroutines).
Tip
To improve the speed of the request-response, it was necessary to fetch the URL using the URL without SSL (Secure Sockets Layer). You can encrypt the transmitted data manually if you want a secure transmission.
At the beginning of this project, the idea of fetching live data was inspired by the paper 3DRepo4Unity: dynamic loading of version controlled 3D assets into the unity game engine by Friston, Sebastian, et al., which describes a plugin for the Unity game engine that allows developers to access and use 3D models and data stored in the 3DRepo platform directly within Unity. This integration makes it easier for developers to access and use 3D data in their projects, streamlining the development process and enabling more complex and sophisticated 3D applications. But later, I switched from fetching entire graph assets to showing a simple text from an HTTP request because of the high hardware and network transfer cost while using 3DRepo4Unity.
Note
The data is transmitted by a Web API created in ASP.NET Core Web API. The server used to install this project was provided for free by Sistemas RSA.
The section is designed to cover the schedule and progress of the project.
Progress 85%:
January 2023 (completed)
Definition of goals, schedule, and design.
February 2023 (completed)
Create the environment in virtual reality using Unity.
March 2023 (completed)
Research and read related papers on the topics covered in this project.
Present the project proposal in class and provide a paper proposal.
Test and integrate dynamic loading of 3D Assets and gaze interaction with an object on the code.
April 2023 (80% completed)
Implement the SDK and plugins in the Unity project and test the new code.
Create the web API project to improve data-transmission performance.
Create the website with the research log content.
Present in class the research log.
Finish visual details in the Unity project.
May 2023
Create the standalone executable version for Windows and Mac OS.
Final presentation in class.
Demo video
Acknowledgments
The author thanks Ph.D. Andrew T. Duchowski from Clemson University for the helpful discussions about this work and for providing guidelines on the elaboration of this project and to Sistemas RSA for providing all the resources to implement the web API. The information provided in this web site are below the author.