Recent

2022.01.03 Our new CAVE-type display, an ActiveCube by Virtalis, is now fully installed and working in the Appenzeller Visualization Laboratory

 

Software Configuration and Description: Unity

Another great solution for developing your own virtual or augmeneted reality application is Unity. While traditionally being a game engine, it provides a lot of support for a long list of virtual and augmented reality devices. This includes Android and iPhones but also head-mounted display systems, such as teh HTC Vive, Microsoft Hololens, or Magic Leap One. Most of those devices provide additional frameworks and toolkits to make the development of applications for those devices easier. In addition, Unity's asset store provides access to additional tools, models, and frameworks developed by Unity and 3rd party developers.

There are a lot of tutorials available for Unity, including ones made by Unity itself. Unity comes with its own Editor which provides an integrated developing environment. Unity is programmed in C#. It is usually best to start with the tutorials for the specific device you intend to develop for. But additional tutorials and online material can be a great resource for developing your application further.

To get started with VR, there are a lot of tutorials available, including one provied by Unity itself and others designed for the HTC Vive. When using Mixed Reality devices, such as HP's, you can follow this tutorial using the mixed reality toolkit (MRTK). Specific tutorials are available for capturing input from the motion Mixed Reality controllers. 3D models can be a useful resource as well to integrate with your VR scenario. Some sample code for using MRTK is also available. This is a short list of web sites that provide access to some freely available 3D models. Another alternative is to use toolkits that are already geared toward the development of VR applications, such as the Virtual Reality Toolkit (VRTK).

Coding your application in Unity is relatively easy. It uses C# which is similar to other object-oriented languages, such as C++ or Java. The classes for Unity have to follow a fairly rigid structure in which the filename has to always match the classname. However, Unity takes care of that for you in most instances as it lets you create a new script in the project area that can then be dragged onto any object within your project hierarchy. This will also create some basic member functions for you, such as the start method which will be executed at the very beginning when you start the application. When you drag a script over, make sure all other scripts you added currently compile properly as that can prevent Unity from adding the new script to the desired object.

You can even create virtual and augmented environments for multiple participants. Unity provides access to multi-player configurations which are synchronized through the network using MLAPI. To set this up requires a little more effort since MLAPI is not yet directly integrated with Unity by adding it using the package manager. But MLAPI comes with instructions on how to configure it properly. This URL also provides access to good instructions on how to use MLAPI within Unity and how to setup a multi-player scenario. This then allows you to synchronize participants and exchange data over the network. For adding the prefab to be synchronized over the network within the NetworkManager, you may have to make the inspector panel a little wider for all the entries to show up properly. Otherwise, Unity may not let you add the prefab.

A useful addition for different imaging and other helpful tasks for AR applications is the Vuforia library. For example, it can be used to identify images, such as QR markers, and provide the position where it was found. This can then be used to add virtual objects to form the AR. Installing Vuforia can sometimes be a little tricky. The installation instructions suggest to add a Unity package to your project to set it up. Sometimes, it is necessary to add it to Unity via the git-URL within Unity's package manager. The installation instructions provide all the details. To get started, Viforia provides various tutorials on how to use Vuforia in your own Unity-based AR application.