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
Home
HoloLens

HoloLens Dev 101 : How to Build a Basic HoloLens App in Minutes

Nov 23, 2016 09:25 PM
Dec 10, 2016 02:40 AM
3D modeling scene with basic geometric shapes and directional lights.

Now that we've got all of our software installed, we're going to proceed with the next step in our HoloLens Dev 101 series—starting a fresh project and building it into a Holographic application. Then we will output the application to the HoloLens Emulator so we can see it in action.

For some newcomers, too much information too early can often be a hindrance, and is better grasped later after you've gotten a chance to play around a bit. So the primary goal in this guide is instant gratification. I want to get you in and out of the building process as fast as possible. Aside from Steps 5 and 6 below, these are the minimal steps required to get a rough project started.

We will be using Unity, one of the easiest ways to get started with 3D application development, but don't get hung up on all of the options and tools you see available. Like I said, we want to get you in and out right now. My next guide in this series will be on the basics of the Unity interface, so you'll be able to grasp it better then.

If you learn better from video instructions, make sure to check out our video above. Either way, the written instructions below can help aid you through the process.

Create the Unity Project

Assuming you followed my tutorial in this series on setting up the software, you should have a folder on your desktop with the HoloToolkit in it. Open that folder up, then double-click on Assets and you should see a bunch of files inside. Using your Control key, select everything but the "HoloToolkit-Examples" directory.

File directory showing various folders and files related to web development projects.

Now open up Unity, then click on the "New" button on the Project selection screen.

List of projects in a cloud-based application.

In the name field, type NRN HoloLens Dev 101 and click on "Create project." You can, of course, use a different name if you want to, but it might cause some confusion down the line.

User interface for software program settings with fields for project name, version number, and analysis options.

Install the HoloToolkit in Your Project

First, let's bring the HoloToolkit into Unity by hitting Alt + Tab to bring the window with the HoloToolkit assets ready for us. We should see our selection from Step 1 still highlighted.

Unity interface displaying a 3D scene with a file explorer open.

Now drag it onto the Assets directory in the Project window. After a few moments, all of those files will be copied into Unity.

Screenshot of a computer file directory showing various folders and files related to a project.

Note: Sometimes you will get a few errors in the console after this process, but you can just hit the "Clear" button.

Set Up the HoloToolkit

It's time to use our newly acquired HoloToolkit menu. Here we will set up our new project with all of the settings necessary for Unity to build its player for the HoloLens. So go HoloToolkit in the main menu, click on "Configure," then select "Apply HoloLens Project Settings." Unity will need to reload to apply these changes, so do so when prompted.

Menu options in a software application interface, including settings for catalog, sharing, and help.

Next, using the same menu, select "Configure" and then "Apply HoloLens Scene Settings." These scene settings are HoloLens-specific camera and skybox components.

HoloLens Dev 101 : How to Build a Basic HoloLens App in Minutes

Go back to "Configure" once again in the HoloToolkit menu and choose "Apply HoloLens Capability Settings." A window will appear with four options—Microphones, SpatialPerception, WebCam, and InternetClient—make sure they are all checked. These turn specific features on for the HoloLens, so we can't get this working without them.

Settings menu for applying capabilities in a software interface.

Save the Scene with the New Settings

Now we need to save our scene so it will remember our changes. To do that, we need a place to save it, so let's create a folder by right-clicking on "Assets" in the Project window and selecting "Create," then "Folder." Simply name this new folder Scenes.

Menu options in video editing software for creating and managing projects.

Now that we have our folder, in the main menu, go to "File," then "Save Scenes As." In the pop-up window, select your new Scenes folder, use Main as the file name, then hit "Save."

HoloLens Dev 101 : How to Build a Basic HoloLens App in Minutes

Create Objects in the Scene

In order to have something to look at instead of empty space, we are going to add some objects to the Scene window. Since we're only concentrating on getting set up fast in this guide, the objects won't actually do anything other than look pretty.

Go to the "GameObject" menu option, choose "3D Object," then select "Cube." This will give you a cube sitting in the center of the Scene window, and you'll also notice that "Cube" appears in the Hierarchy window. Now, repeat this process to add a Sphere, Capsule, and Cylinder object as well.

Menu options displayed in a software interface.

Position the Objects

Like mentioned previously, we will go over the basics of Unity in our next guide, but for now, know that the Inspector window is a very important part of this interface. One component that is in the Inspector for every object in Unity is called "Transform," which details the position, rotation, and scale of each object.

In this step, we are going to change the positions of the objects we created. Currently, all four objects are sitting on top of the camera so we cannot see them, but we'll fix that.

In your Hierarchy window, select "Cube." Over in the Inspector, look at the Transform component and change its Z position to 6. We are going to repeat this process 3 more times for the other objects, but with different inputs for each.

Unity editor interface showing color settings and parameters for a 3D object.

Now select "Sphere" from the Hierarchy window and change its Z position to -6.

Do the same for "Capsule," but this time, set its X position to 6. Then, for the "Cylinder" object, make its X position -6.

Unity game development interface with Inspector panel displaying object properties.

This is what your Scene should look like now:

3D modeling workspace with basic geometric shapes and a sun icon.

Build the Application

That's all we're going to do right now as far as the scene goes, so now it's time to build and compile it. Go to "File" in the main menu, then "Build Settings."

Menu options in Unity interface for a 3D project.

Click on the "Add Open Scenes" button to add the current scene to the list.

HoloLens Dev 101 : How to Build a Basic HoloLens App in Minutes

Choose "HoloLens" as the Target device and make sure Unity C# Projects is checked.

HoloLens Dev 101 : How to Build a Basic HoloLens App in Minutes

Now click on "Player Settings" and check Virtual Reality Supported in the Inspector. You should see the word Windows Holographic appear under the box to know it was done correctly.

HoloLens Dev 101 : How to Build a Basic HoloLens App in Minutes

Now just click on the "Build" button, then create a folder in Explorer called App. Highlight that folder, then hit "Select Folder" to continue.

Folder selection dialog displaying project files on a computer.

Now it will go through the build process.

Load the Project into Visual Studio

When the build process is done, a Windows Explorer window will pop up—this is our main project folder. Open up the new "App" folder, then double-click on the "NRN HoloLens Dev 101.sln" file. This will load our project into Visual Studio.

Visual Studio Community 2015 interface with file explorer.

This is what it should look like right now:

A screenshot of a programming environment with a dark theme, displaying code in a code editor.

Compile & Deploy

When Visual Studio has loaded up our project, we can see all the files in the Solution Explorer on the right. It appears to have changed in recent builds, but just in case— make sure the third solution in the Solution Explorer is selected (NRN HoloLens Dev 101). You will have two Assemblies, and then your third, which is the proper project.

HoloLens Dev 101 : How to Build a Basic HoloLens App in Minutes

Now go to the "Debug" dropdown in the toolbar and select "Release."

Microsoft Visual Studio interface displaying the Debug menu with options for ARM, Mute, and Remote.

Click on the "ARM" dropdown and select processor "x86" since that is the processor the HoloLens uses.

Microsoft Visual Studio interface displaying the menu options for project configuration.

Select the "HoloLens Emulator" as our target device. If you have the HoloLens, you could select "Remote Machine" instead and choose your HoloLens.

List of mobile emulators and options in a software development environment.

Click the green play button right next to those dropdowns in the toolbar, and watch it go to work. The program will go through the compilation process, load the HoloLens Emulator, deploy the app, and run the app on the HoloLens.

3D model of a glossy cylindrical shape on a black background.

Once it is loaded, you can use your mouse to move around and look at the various objects we placed for our test.

Pretty Easy, Right?

Congrats, and welcome to your very first running HoloLens program. May it be the first of many. If you want to just create a blank project in the future, you can just follow this how-to but skip Steps 5 and 6.

As I've already mentioned, we'll be diving into Unity in a future tutorial now that you've at least played around with it a bit, so stayed tuned for that one here on NextReality.

Screenshots by Jason Odom/NextReality

The next big software update for iPhone is coming sometime in April and will include a Food section in Apple News+, an easy-to-miss new Ambient Music app, Priority Notifications thanks to Apple Intelligence, and updates to apps like Mail, Photos, Podcasts, and Safari. See what else is coming to your iPhone with the iOS 18.4 update.

Related Articles

Comments

No Comments Exist

Be the first, drop a comment!