Home Mobile HoloLens Beginner's Guide

HoloLens Beginner's Guide

By Jason M. Odom
books-svg-icon Book
eBook $43.99 $29.99
Print $54.99
Subscription $15.99 $10 p/m for three months
$10 p/m for first 3 months. $15.99 p/m after that. Cancel Anytime!
What do you get with a Packt Subscription?
This book & 7000+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook + Subscription?
Download this book in EPUB and PDF formats, plus a monthly download credit
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook?
Download this book in EPUB and PDF formats
Access this title in our online reader
DRM FREE - Read whenever, wherever and however you want
Online reader with customised display settings for better reading experience
What do you get with video?
Download this video in MP4 format
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with video?
Stream this video
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with Audiobook?
Download a zip folder consisting of audio files (in MP3 Format) along with supplementary PDF
What do you get with Exam Trainer?
Flashcards, Mock exams, Exam Tips, Practice Questions
Access these resources with our interactive certification platform
Mobile compatible-Practice whenever, wherever, however you want
BUY NOW $10 p/m for first 3 months. $15.99 p/m after that. Cancel Anytime!
eBook $43.99 $29.99
Print $54.99
Subscription $15.99 $10 p/m for three months
What do you get with a Packt Subscription?
This book & 7000+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook + Subscription?
Download this book in EPUB and PDF formats, plus a monthly download credit
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook?
Download this book in EPUB and PDF formats
Access this title in our online reader
DRM FREE - Read whenever, wherever and however you want
Online reader with customised display settings for better reading experience
What do you get with video?
Download this video in MP4 format
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with video?
Stream this video
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with Audiobook?
Download a zip folder consisting of audio files (in MP3 Format) along with supplementary PDF
What do you get with Exam Trainer?
Flashcards, Mock exams, Exam Tips, Practice Questions
Access these resources with our interactive certification platform
Mobile compatible-Practice whenever, wherever, however you want
  1. Free Chapter
    Welcome to the New World
About this book
HoloLens revolutionizes the way we work and interact with the virtual world. HoloLens brings you the amazing world of augmented reality and provides an opportunity to explore it like never before. This is the best book for developers who want to start creating interactive and intuitive augmented reality apps for the HoloLens platform. You will start with a walkthrough of the HoloLens hardware before creating your first app. Next you will be introduced to the various HoloLens sensors and find out how to program them efficiently so that they can interact with the real world seamlessly. Moving on, you will learn how to create smart animations and add video overlay that implements real-time tracking and motion-sensing abilities to your HoloLens app. Finally, you will learn how to test your app effectively.
Publication date:
April 2017
Publisher
Packt
Pages
376
ISBN
9781786464729

 

Chapter 1. Welcome to the New World

We live in very exciting times. Technology is changing at a pace so rapid that it is becoming near impossible to keep up with these new frontiers as they arrive; they seem to arrive on a daily basis now. Moore's Law continues to stand, meaning that technology is getting smaller and more powerful at a constant rate. As I said, very exciting.

One of these new emerging technologies that finally is reaching a place more material than science fiction stories is Augmented or Mixed Reality. Imagine a world where our communication and entertainment devices are worn, and the digital tools we use, as well as the games we play, are holographic projections in the world around us. These holograms know how to interact with our world and change themselves to fit our needs. Microsoft has led the charge by releasing such a device: the HoloLens.

The Microsoft HoloLens changes the paradigm of what we know as personal computing--we can now have our Word window up on the wall (this is how I am typing right now), we can have research material floating around it, and we can have our communication tools, such as Gmail and Skype, in the area as well. We are finally no longer trapped by a virtual desktop, on a screen, sitting at a physical desktop; we aren't even trapped in the confines of a room anymore.

 

What exactly is the HoloLens?


The HoloLens is a first of its kind head-worn, standalone computer with a sensor array, which includes microphones and multiple types of camera, a spatial sound speaker array, a light projector, and an optical waveguide.

The HoloLens is not only a wearable computer, it is also a complete replacement for the standard 2D display. It has the capability of using holographic projection to create multiple screens throughout an environment and fully 3D-rendered objects. With the HoloLens sensor array, these holograms can fully interact with the environment you are in.

The sensor array allows the HoloLens to see the world around it, to see the input from the user's hands, and for it to hear voice commands. Although Microsoft has been very quiet about what the entire sensor array includes, we have a good general idea about the components used in the sensor array; let's take a look at them:

  • One IMU: The Inertia Measurement Unit (IMU) is a sensor array that includes an accelerometer, a gyroscope, and a magnetometer. This unit handles head orientation tracking and compensates for the drift that comes from the Gyroscope's eventual lack of precision.
  • Four environment understanding sensors: These together form the spatial mapping that the HoloLens uses to create a mesh of the world around the user.
  • One depth camera: This is also known as a structured light 3D scanner. This device is used for measuring the 3D shape of an object using projected light patterns and a camera system. Microsoft first used this type of camera inside the Kinect for the Xbox 360 and Xbox One. 
  • One ambient light sensor:Ambient light sensors or photosensors are used for ambient light sensing and proximity detection.
  • 2 MP photo/HD video camera: This is used for taking pictures and video.
  • Four-microphone array: These do a great job of listening to the user and not the sounds around them. Voice is one of the primary input types with HoloLens.

Putting all of these elements together forms a Holographic computer that allows the user to see, hear, and interact with the world around them in new and unique ways:

 

What you need to develop for the HoloLens


The HoloLens development environment breaks down into two primary tools, Unity and Visual Studio. Unity is the 3D environment that we will do most of our work in; this includes adding holograms, creating user interface elements, adding sound and particle systems, and other things that bring a 3D program to life.

Visual Studio on the other hand is the glue that makes everything work. Here, we write scripts or machine code to make our 3D creations come to life and add a level of control and immersion that Unity cannot produce on its own.

Unity

Unity is a software framework designed to speed up the creation of games and 3D-based software. Generally speaking, Unity is known as a game engine but the more apparent the holographic world becomes, the more we will use such a development environment for different kinds of applications.

Unity is an application that allows us to take 3D models, 2D graphics, particle systems, and sound to make them interact with each other and our user. Many elements are dragged and dropped and plugged and played; what you see is what you get. This can simplify the iteration and testing process. As developers, we most likely do not want to build and compile little changes we make in the development process forever. This allows us to see the changes in context to ensure that they work; then once we hit a group of changes, we can test them on the HoloLens ourselves. This does not work for every aspect of HoloLens-Unity development, but it does work for a good 80%-90%.

Visual Studio community

Microsoft Visual Studio Community is a great, free Integrated Development Environment (IDE). Here, we use programming languages, such as C# or JavaScript, to code changes in the behavior of objects, and generally make things happen inside of our programs.

HoloToolkit - Unity

The HoloToolkit-Unity is a repository of samples, scripts, and components to help speed up the process of development. This covers a large selection of areas in HoloLens development, such as the following:

  • Input:Gaze, gesture, and voice are the primary ways in which we interact with the HoloLens.
  • Sharing:The sharing repository helps allow users to share holographic spaces and connect to each other via the network.
  • Spatial Mapping:This is how the HoloLens sees our world. A large 3D mesh of our space is generated and give our holograms something to interact with or bounce off of.
  • Spatial Sound:The speaker array inside the HoloLens does an amazing job of giving the illusion of space. Objects behind us seem like they are behind us.

HoloLens emulator

The HoloLens emulator is an extension to Visual Studio that will simulate how a program will run on the HoloLens. This is great for those who want to get started with HoloLens development but do not have an actual HoloLens, yet. This software does require the use of Microsoft Hyper-V, a feature only available inside the Windows 10 Pro operating system. Hyper-V is a virtualization environment, which allows the creation of a virtual machine. This virtual machine emulates the specific hardware, so one can test without the actual hardware.

Visual Studio tools for Unity

This collection of tools adds IntelliSense and debugging features to Visual Studio; if you use Visual Studio and Unity, these are a must have:

  • IntelliSense:An intelligent code completion tool for Microsoft Visual Studio. This is designed to speed up many processes when writing code. The version that comes with Visual Studios tools for Unity has Unity-specific updates.
  • Debugging: Before this extension existed, debugging Unity apps proved to be a little tedious. With this tool, we can now debug Unity applications inside Visual Studio, thus speeding the bug squashing process considerably.

Other useful tools

The following are some the useful tools that are required:

  • Image editor: Photoshop and Gimp both are good examples of programs that allow us to create 2D UI elements and textures for objects in our apps.
  • 3D modeling software: 3D Studio Max, Maya, and Blender are all programs that allow us to make 3D objects that can be imported in Unity.
  • Sound editing software: There are a few resources for free sounds on the Web. With that in mind, Sound Forge is a great tool for editing those sounds, layering sounds together to create new sounds.
 

Installing the software


Now, we will get our development environment installed and set up so that we can start building the next killer app for HoloLens. We will start with our main tools, Visual Studio and Unity HoloLens technical preview, and then add the extensions that will help speed things along.

Installing Visual Studio

Microsoft has made the installation process for Visual Studio very simple. Just be warned that it can take a while to download and install it:

 

  1. Click on Download Community 2015; this is a free version of Visual Studio that works well with Unity and the HoloLens environment. By default, you should be installing at least Visual Studios 2015 Update 3.
  1. Run vs_community. exe and complete the installation process.
  2. Create a Microsoft Developers account (this is a requirement for the HoloLens development).
  3. The first time you run VS2015, you will be prompted to input your account credentials.

Unity HoloLens technical preview

Now, we will install Unity HoloLens technical preview. At the time of writing this, version 5.4. 0f 3 is the most recent and stable version. This is a custom version of Unity made to work specifically with HoloLens. As a result, it does automate a few processes for HoloLens developers:

To install Unity HoloLens technical preview, we will need to perform the following steps:

  1. Go to https://unity3d.com/partners/windows/hololens.
  2. Scroll down to the bottom of the page.
  3. Click on the Unity Download Assistant.
  4. Follow the instructions to complete the installation process.
  5. You will need to create an account with Unity.

Visual Studio 2015 tools for Unity

In your web browser, go to https://visualstudiogallery.msdn.microsoft.com/8d26236e-4a64-4d64-8486-7df95156aba9. Later, click on the Download button and run vstu2015.exe:

HoloLens emulator

To install the HoloLens emulator, perform the following steps:

  1. Go to http://go.microsoft.com/fwlink/?LinkID=823018.
  2. Run EmulatorSetup.exe once it finishes downloading.
  3. Install the emulator.

Note

This will not install if you do not have Windows 10 Pro installed on your development PC.

  1. This installation process can take a while.

HoloToolkit-Unity

To install HoloToolkit-Unity, perform the following steps:

  1. Enter https://github.com/Microsoft/HoloToolkit-Unity in your browser.
  2. Click on Clone or download.
  3. Click on Download ZIP.
  4. Once the ZIP file is downloaded, unzip the file to your desktop; we will copy this into our project later.
 

Unity3d quick overview


In the Unity3d quick overview, we will have a quick, very general overview of Unity. In the next chapter, we will begin the first stages of our project. With the following overview, what you will learn in the chapter will stick a little bit better:

  1. Click on the Unity HoloLens icon to run Unity, as follows:
  1. If you have a Unity account, enter your account name and password, otherwise you will need to create a new account before you can move forward.
  1. Type the name of the project--HoloLens Beginners Guide--into the Project name input field.
  2. Ensure that you have 3D selected as the project type and click on Create project.

The main view

When the project is created and the program finishes loading, you should see the following default view:

Here, we can see our main work areas:

  • Scene: This is where we view our scene and can make certain types of changes.
  • Hierarchy: This is a list of all objects currently in the scene.
  • Project Window: Here, we have all the assets of the project. This will list our 3D models, scripts, textures, materials, sounds, prefabs, and all other elements of the programs.
  • Inspector: When an object is selected, we will be given many changeable details about that object.

You may notice a few in at the upper part of certain windows. These windows offer other functions, as shown in the following screenshot:

  • Console: Here, we can have the debug information presented to us. This allows us to test certain parts of a program to ensure that it is working.
  • Game View: When we test our project on our development computer, this is the window that our program will appear in; this is the main camera view.
 

Summary


In this chapter, we got to know a little bit about the HoloLens. We have installed and set up the development environment, so we can begin our journey into this new world. Here the only limitations are our imaginations.

About the Author
  • Jason M. Odom

    Jason Odom is a game developer with nearly 20 years of experience working on titles for companies such as Activision and Take 2 Interactive, along with years of game development teaching and mentoring. He is the founder of Thought Experiment, a start-up mixed reality studio, and he is currently working on HoloQuest and CrossTrainMR properties for HoloLens. When he is not making software and applications, he is a loud and proud mixed reality evangelist with a highly active YouTube channel, and a prolific technology blogger for NextReality.

    Browse publications by this author
Latest Reviews (1 reviews total)
Author put a lot of effort especially when they technology is in-process , I mean at very early stage.
HoloLens Beginner's Guide
Unlock this book and the full library FREE for 7 days
Start now