Wednesday, April 13, 2016

Getting Started with the HoloLens


At Last

The HoloLens team has announced shipments have started. Unboxing videos are popping up everywhere. My Twitter and Facebook feed are yielding random posts of friends opening theirs. Unity has finally announced the availability of the free Unity bits that supports the HoloLens. <EvilLaugh>The world is mine... at last </EvilLaugh>

Want a HoloLens? You can apply for a dev kit and still get going with development this very minute.

Alas, poor Adam, he has not a HoloLens and I'm assuming you don't either or you wouldn't be reading this - you'd be off exploring a galaxy or creating something in HoloStudio. But that's OK (for a short while anyways)! We don't need a HoloLens in our hands to be able to get started developing for one, just as you don't need a physical phone to start phone development. Yes, it's awesome to have one, yes the world is a better place when you deploy to a physical device - but we're developers. We can start developing now and not wait. Let's get to it!

Don't want to read? Watch the video!



Getting Started


We just need a few things to get started......

  1. Windows 10 Pro, Enterprise, or Education
  2. Unity 5.4 HoloLens Preview (Install the Editor and the UWP Runtime - two separate installs)
  3. Visual Studio 2015 Update 2 (Be sure you check off UWP Tools 1.2+ and Windows 10 SDK if you use a custom install)
  4. HoloLens Emulator


The above requirements are outlined here in more detail but I want to call one thing out. Your system must support Hyper-V or you can't run the emulator. Hyper-V is the virtualization system built into Windows, and is the reason you need Windows 10 Pro/Enterprise/Education and not Home Edition, as Home Edition doesn't support Hyper-V. If you are like me, you may run other software that uses Oracle VirtualBox (specifically Docker's Kitematic in my case) and I find myself switching Hyper-V on and off. If that fits you, there are various options to script out enabling/disabling Hyper-V.

It's all so new

That's true - it is all so new. This is brand new hot off the press API, bits, and documentation. As such you help the HoloLens folks and community out immensely by reporting anything in the HoloLens forums or asking any relevant questions there to help yourself out.

To get started you have a handful of options

  • Create a new HoloLens app from the templates in Visual Studio (installed with the Emulator)
  • Create a new project in Unity and use for ex. the UnityEngine.VR.WSA namespace(s) to access HoloLens specific features
  • Use the samples to get started from the Holographic Academy here
  • Check out Galaxy Explorer 
  • Pour through the HoloLens documentation


There are a couple key concepts to be aware of. The first are the three pillars of Input on the HoloLens: Gaze, Gesture, and Voice. Gaze is what you are looking at (the device direction ie your head position, not your pupils). Gestures allow you to use your hand to interact with the Holograms and applications. Finally voice gives you access to the full Windows 10 speech engine.

Next is the spatial duo. Spatial sound (shameless self promotion alert - check out our //Build talk on Spatial Audio in UWP to understand more about what spatial audio is) and spatial mapping. Spatial audio is literally making audio sound as close to real life positioning as possible. Imagine being able to hear a sound above you or behind you, even though you don't have any speakers above you or behind you (just on the side of your ears). That my friends, is the magic of spatial audio.

Spatial Mapping is my favorite feature of the HoloLens which allows it to do some pretty neat things. Imagine dropping a hologram like a ball onto a real life table and it stays exactly where you dropped it. Now imagine you move the table fast out of the way and the ball now drops to the real floor and stops. This happens because the HoloLens is actually aware of its surroundings - it performs spatial mapping as shown in the image here. This works so well you can drop a hologram onto something, leave the room and come back later and it's still in the same place.



It's all UWP

We can create a UWP app from the templates in Visual Studio or we can create a new project in Unity and export to Visual Studio as a Direct3D or XAML UWP application. It's just a Visual Studio Solution, so we can open it up and deploy it to a device or an emulator.

Keep in mind you can make near any Universal Windows Platform application run on the HoloLens. This is the power of UWP. You can run two different App Views on the HoloLens. In a 2D View, multiple apps from the Windows Store can run and you can pin them all around your environment (for ex to your walls). These would be 'flat' ie 2D apps. Secondly, you can run an app in a holographic view. The holographic view is when you have an app that will be drawing holograms. In this holographic view, no other app can run.

To make UWP apps for the Hololens, as mentioned you can use Visual Studio and the code templates for the HoloLens, or Unity.

But I Don't Know Unity!

That OK. We have plenty of Unity learning resources available outside of the amazing content on Unity's learning site as well such as our video courses on Microsoft Virtual Academy



and our recent GitHub based Unity Workshops from //Build are great for hour long quick starts


Easy Peasy

Getting up and running is pretty straightforward. Next - let your creative juices flow and make some awesome experiences. One thing for you hard-core folks that love lower level information, read all about Hologram stability

Lastly, don't forget to tell the HoloLens Twitter Account about your cool projects! Happy Hacking :)


11 comments:

  1. Excellent Article Adam! Well written and informative. My unit has been ordered and should be arriving in a few days. I'm very excited!

    ReplyDelete
    Replies
    1. ah that's awesome! Keep us updated with what you make!! Thanks!

      Delete
  2. This comment has been removed by a blog administrator.

    ReplyDelete
  3. I don't think you can use your kinect to scan a room. the .XEF format is slightly different from the Kinect .xef format, or at least you'll have to tell us how to select the appropiate options to get it to work.

    ReplyDelete
    Replies
    1. You are absolutely right, my brain must've been on autopilot re xef format :) You can scan with the hololens though and save it (via the web interface - just go to the device ip address and generate a key)

      Delete
  4. This comment has been removed by the author.

    ReplyDelete
  5. It was super cool and fantastic post and I have never been seen ever in my life.Selena Gomez Fur Trench Coat

    ReplyDelete

Note: Only a member of this blog may post a comment.