HoloLens – How to Create Mixed Reality Part 2
Rick McGuire, Senior ADM, provides the second post in this series — an introduction to mixed reality development with a test drive using HoloLens, Unity, and Visual Studio 2015.
With the invention of HoloLens, it is now possible to superimpose a virtual 3D world onto our exiting reality. HoloLens lets you create holograms, virtual objects that appear in the in the same space as our real world, and they seem like real objects!
This is part two of my blog post on HoloLens, we left off creating a simple HoloLens application called Origami and ran it on the HoloLens emulator. If you missed my first post on this topic you can find it here.
Running the Origami app in the emulator was fun, but I wanted to try it out on an actual HoloLens device. One of my peers at the local Microsoft Technology Center (let’s just call him Nick) offered some time on one of our demo devices. I went to the local MTC and spent a couple hours setting up the device, connecting to the portal and uploading my Origami application.
The first thing we need to do is create an .appx package that we can upload to the device. Follow the link here on how to create an appx package from Visual Studio. Here is a quick walk-through; right click on your UWP Origami application and select “Store” -> “Create App Packages…”.
The dialog box will pop up prompting you to decide on if you are planning to upload to the Windows Store, you can choose “No” as we are not uploading to the Windows Store. We just want to upload to the HoloLens Device.
Accept the default setting and click on the “Create” button to generate the package. For more details see the overview on how to package a UWP app with Visual Studio here.
Visual Studio will create the package and place it under the “Release” folder of your project path. In my case it will create “Origami_18.104.22.168_x86.appx” as I targeted the x86 environment for my project (as of this writing the x86 environment is the only environment option supported). The file will be saved to C:\HoloLensProjects\Origami\App\Origami\bin\x86\Release. If you are interested in learning more about making an appx package take a look at this information on creating a package with MakeApps.exe.
Once you have your .appx file created, the next step is to browse to your HoloLens device portal. Navigate to the SYSTEM area on the portal and select the “Apps” link to pull up the App Manager and upload your appx file. Under App package click on the “Browse…” button and navigate to your .appx package.
In my case I will select the “Origami_22.214.171.124_x86.appx” file and then click on the “Open“ button.
Once the appx file is uploaded you can go to the dropdown menu on under “Installed apps” in App Manager and select Origami app, then click on the “Start” button. The app should come up and start running on the HoloLens, that’s it!
There are a lot of cool things you can do on the portal, I don’t have time to cover everything in this post, but one capability I will mention is the “Mixed Reality Capture”. This functionality lets you see and record what the person wearing the HoloLens sees (both reality and virtual objects combined). The picture below is a screen capture from the portal while running the Origami app in our training room. You can see the chair and the other HoloLens devices in the background as well as the virtual objects (balls, paper planes, cubes).
You can record and playback the experiences, in our case we were projecting this to a large PC Screen on the wall.
I Hope this was helpful – I plan to build more projects with HoloLens in the future and look forward to sharing more. The HoloLens developer kits are available for purchase here if you are interested in building and testing apps with a real device. It is quite the experience!
Premier Support for Developers provides strategic technology guidance, critical support coverage, and a range of essential services to help teams optimize development lifecycles and improve software quality. Contact your Application Development Manager (ADM) or email us to learn more about what we can do for you.