An Escape

Project summary:

This project is a Virtual Reality experience using Unity and SteamVR meant to give its user an escape into a calm serene virtual world. As of now, the user is able to pick between 2 different scenes. A calm forest, and lantern lighting festival. The user is also able to connect a fitbit device to monitor heart rate. There is currently code to retrieve other information provided by the device but for this project's purposes, only heart rate is displayed.

Development Process:

In the beginning, we wanted to use a phone's sensors to retrieve information from the user such as heart rate and movement(using the gyroscope) but it seemed as though this was only possible if the Unity project was made for a phone (more specifically an android) that way it could access all of the sensors without any issues. We then tried using a bluetooth connection which also needed some plugins that needed to be created using a java Android application but all of the tutorials we had found were outdated and the features were no longer supported. We then ventured into retrieving data from a fitbit device which after a few days of trying different api calls and authentication methods we were able to find a very helpful tutorial (Link in resources below). We used the authentication methods and general data retrieval methods from the tutorial then added our own methods and API calls to retrieve the heart rate information from our registered fitbit device. To be able to do this we had to register our application under the fitbit developer's site. When registering our application, we set our callback URL (which gives us the return code we need to complete the authentication) to google.com because we weren't able to use simple webview to view the data. The code is then available to copy from the url in the address bar.

We also set the OAuth to personal that way we are able to retrieve the type of information that we needed.

On the design side of things we used assets we found on the unity store to create our scenes

The Scenes:

The forest scene was created using a terrain and beautiful trees we found in the unity asset store at a bargain. We used the calming ambient sound of wind and birds to bring the forest to life while keeping the environment relaxing. To guide the breathing of the user without using visual cues to detract from the scene, we decided to signify the breathing pattern using audio cues. In the background you can faintly hear the sound of a bamboo rocking fountain to help the user keep a steady breathing rhythm. There is a lantern located in the scene that will be used to load the next scene.

Inspired by Tangled, the greatest Disney princess movie, our next scene puts you in the middle of a lake during a lantern festival. You are seated in a boat where you can admire the starry night sky and the floating water lanterns. Slowly, the sky lanterns start to float up creating a beautiful scene. To implement this we applied force to the sky lanterns on the y axis to float them upwards and also on the x axis making them bob side to side to make them behave a bit more realistically. To avoid the lanterns looking too uniform we generate a random number from a range to apply the force. When the lanterns reach a certain height in the scene they respawn to their initial starting position and continue floating up, creating a never ending lantern festival. There is a leaf in the scene to send the user back to the forest scene.


How to run the project:

Upon loading the project, click on the "connect to fitbit" button. This will then take you to a webpage that prompts you to log in to your fitbit account. Once successfully logged in it will then redirect you to the google page discussed above from which you will retrieve the return code. Paste it into the field and click the connect button once again. The heart rate should then begin displaying. If not, then make sure that your fitbit device is synced up to your phone. After that, choose the scene that you'd like to begin with. Each scene has an object that doesn't quite belong but when you interact with it, it takes you to the other scene*.

*This functionality recently broke so it is not working