Header Banner
Next Reality Logo
Next Reality
Augmented & Mixed Reality News, Rumors & Dev Guides
nextreality.mark.png
Apple Snap AR Business Google Instagram | Facebook NFT HoloLens Magic Leap Hands-On Smartphone AR The Future of AR Next Reality 30 AR Glossary ARKit Dev 101 What Is AR? Mixed Reality HoloLens Dev 101 Augmented Reality Hololens How-Tos HoloLens v. Magic Leap v. Meta 2 VR v. AR v. MR

HoloLens Dev 101: Building a Dynamic User Interface, Part 1 (Setup)

Sep 1, 2017 07:05 PM
Nov 17, 2017 10:43 PM
3D models of geometric shapes: sphere, rounded rectangle, and rectangular prism.

Alright, let's dig into this and get the simple stuff out of the way. We have a journey ahead of us. A rather long journey at that. We will learn topics ranging from creating object filtering systems to help us tell when a new object has come into a scene to building and texturing objects from code.

But, before any journey, we need to get prepared.

There have been some issues with versions of software and SDKs over the last few weeks, which has caused downtime for more than a few developers I know. Hopefully, by the time you are working on this series, all of those issues are cleared up, but for now here is what I recommend:

Alright, if these are in and working, you should be good to go.

Install the MixedRealityToolkit-Unity

Now all that is left is installing the MixedRealityToolkit-Unity (MRTU). This is a toolset that Microsoft and the Windows Mixed Reality developer community have built up for the last year and a half, and it really does a great job of making certain elements of mixed reality development simple.

To download MRTU first go to the GitHub repository and click on the "Clone or download" button.

GitHub repository overview for a project, highlighting the number of stars and contributions.

A small context menu will open up. Select the "Download Zip" option.

GitHub repository page showcasing an open-source project with download options.

Once the download is complete, open up the zip and drill into the MixedRealityToolkit-Unity -> Master -> External -> Unity packages directory.

HoloLens Dev 101: Building a Dynamic User Interface, Part 1 (Setup)

Make sure you already have Unity open and double-click the "HoloToolkit-Unity-v.1.2027.1.0" Unity package file.

Import Unity Package window displaying various components and settings.

Click the "All" button and then Click on "Import." Unity will begin doing a bunch of work which can take a few minutes.

Loading screen in Unity game development environment.

Once it reaches the end of that progress bar, MRTU is installed and we are ready to go.

Set Up the Prefabs

Now we need to take a few of the components from our freshly installed MRTU and get our scene setup. We are going to create a HoloLens specific camera system, an input manager, and a cursor. No coding is necessary. Really, it is as easy as drag and drop.

First up, look in your "Project" view and open up the "HoloToolkit" directory. Then open up the "Input" directory.

HoloLens Dev 101: Building a Dynamic User Interface, Part 1 (Setup)

Next, open up the "Prefabs" directory.

HoloLens Dev 101: Building a Dynamic User Interface, Part 1 (Setup)

You should now see the following prefabs and a "Cursor" directory.

HoloLens Dev 101: Building a Dynamic User Interface, Part 1 (Setup)

Drag both the InputManager and HoloLensCamera into your "Hierarchy" view.

Screenshot of a Unity interface displaying a sky scene with clouds and sun, highlighting a side panel with a red arrow.

Now open the Cursor folder by double-clicking it, then drag and drop the Cursor prefab it into the "Hierarchy" view as well.

Prepare Unity for Export to the HoloLens

Now that we have our starting scene ready to go, we need to complete a few more steps to help Unity get our application to our HoloLens. Fortunately, for us, the MRTU simplifies this as well.

First up, click "File" and "Save Scene As" from the main menu. Right click in the Assets folder and create a new folder called Scenes. Now, let's save our scene file in that folder, calling it MainScene.

HoloLens Dev 101: Building a Dynamic User Interface, Part 1 (Setup)

Now, click on the "HoloToolkit" option in the main menu, click on the "Configure" heading, and click on the "Apply HoloLens Capability Settings."

Menu options for configuring capabilities in a software application.

When the Apply HoloLens Capability Settings box appears, click and select all four options: Microphone, Spatial Perception, Webcam, Internet Client. Then, hit the "Apply" button.

Settings menu for HoloLens capabilities in a software interface.

Next, in the same HoloToolkit -> Configure menu, click on "Apply HoloLens Project Settings."

Menu options for configuring project settings in a software application.

Make sure that all four check boxes are selected and hit the "Apply" button. When the "Project reload required!" window appears, select "Yes."

Unity editor interface with a dialog box displaying an error message.

Once Unity has gone through the reload process, we are ready to really begin this new adventure.

Next, we will design a system that knows when a new object has entered the scene.

Cover image and screenshots by Jason Odom/Next Reality

You already know how to use your phone. With Gadget Hacks' newsletter, we'll show you how to master it. Each week, we explore features, hidden tools, and advanced settings that give you more control over iOS and Android than most users even know exists.

Sign up for Gadget Hacks Weekly and start unlocking your phone's full potential.

Related Articles

Comments

No Comments Exist

Be the first, drop a comment!