6 DoF Smartphone VR application Tutorial
Introduction
Presentation
You will learn how to create a virtual reality smartphone app type google Cardboard where you can move in the virtual space. We combine ARCore with the stereoscopic vision of Google Cardboard.
You can find three levels of description:
>> "in a nutshell" << is a memo of the procedure
>>"step by step" << presents the process, if you are familiar with Unity
>>"all the steps" << presents the process and all the manipulations are detailed
What is 6Dof?
6DoF stands for "Six Degrees of Freedom". With Google Cardboard, or most of smartphone VR applications, you can just turn the head up and down, left and right, or tilt your head around the axe of your nose: it changes the visual and audio feedback. Here, we have three degrees of freedom. Most of the time, you cannot walk front and backward, left and right, or up and down (three other degrees of freedom). The idea of this tutorial is to create an application with six degrees of freedom: the three axes of rotation (head orientation), and the three axes of translation (moving) in a smartphone VR application type Cardboard.
How to do 6DoF VR with a smartphone?
To create a VR smartphone application with 6 degree of freedom, you can enable 6Dof in a small area with Google Daydream: https://developers.google.com/vr/develop/unity/3dof-to-6dof
However, if you want to use 6DoF within an virtually unlimited space, or with Google Cardboard, you can use this hacking technique: combine it with ARCore tracking. We describe how to do that in this tutorial. You can use this as a starting point as well with your own rendering: 1) apply your rendering to the ARCore Camera OR 2) re-use the ARCore camera transform (position and rotation) for your own custom camera.
Why?
This technique is incredibly convenient to do research on VR remolty. You just need a compatible smartphone and a smartphone VR headset for the stereoscopic view ( /!\ to work with this technique, you need to ensure the smartphone camera is not hidden).
Requirements
In this tutorial, we consider you know how to generate an Android application Android SDK 7.0 (API Level 24) from a Unity project, and you have the set up to build such app . Otherwise, you can check the tutorial here: https://sites.google.com/ensc.fr/laurenthevin/scientific-mediation/accessible-treasure-hunting/tutorial-accessible-treasure-hunting from the section "Create the smartphone app"
You use should Unity 2017.4.34f1 or later. In this tutorial, I use Unity 2019.2.10f1 (64-bit)
A smartphone compatible with AR core (https://developers.google.com/ar/discover/supported-devices)
Other:
Official quick starting guide for ARCore: https://developers.google.com/ar/develop/unity/quickstart-android