Microsoft HoloLens: Course 101E – Ch. 1 – Project Creation

Microsoft HoloLens: Course 101E – Ch. 1 – Project Creation


In this chapter, we’ll load our sample project, add some holograms to the scene, and then we’ll deploy that project to the HoloLens emulator. You can find the sample project at the link below. First, we’ll launch Unity at the top, click “Open” and then browse to the folder where you extracted the starter project then click “Select Folder” go to the file menu click “Save scene as” and name your scene “Origami”. Now we’re going to update our camera to be a holographic camera. Click on the main camera on the left in the hierarchy. We’re going to do two things to the camera: – we’re going to change it’s position to be the origin – and we’re going to change it’s clear-color, so that it clears to black. Everything that renders as black will be transparent when viewed with the device. First, go over to position and change Y to 0 and Z to 0, go down to “Clear Flags”, set it to “Solid Color”, and then click the background and change that to black. Over in the hierarchy panel on the left, click “Create” and then “Create Empty”, this creates a new game object that we are going to put our other scene objects in. Rename this object by right-clicking and selecting “Rename” and name the object “Origami Collection”. Now, on the bottom, in the Project Pane, click on the holograms folder This contains a set of pre-built assets that we’re going to use to bring art into our application. Go ahead and take the stage object and drag it directly into “Origami Collection”. You’ll see that it appears as a child if you dragged it correctly. Drag Sphere1 and Sphere2 to be children of “Origami Collection” in the same way. Next, we’ll add some lighting that will make our holograms look great. Click on the directional light and then right-click and delete it. Take the Lights asset and drag it into the root of the Scene by dropping it in the empty area. Next, let’s move the “Origami Collection” so that it appears in front of the user. Click on the “Origami Collection” and change it’s position to 0 for X -.5 for Y and 2.0 for Z This will put it .5 meters below the user’s head and 2 meters in front of the user’s head when the app starts. You can click the play icon at the top of the scene to preview what this will look like. Click the play icon again to stop. Go up to the File menu and click “Build settings…” choose Windows Store and then under SDK, choose Universal 10. For the Build Type, select “D3D” (Direct3D), and then check off the box that says “Unity C# Projects”. Now, make sure you click “Add Open Scenes” in order to add the current scene to our project. Click “Build” at the bottom and now we’re going to choose where to place the Visual Studio project that Unity will generate. Click “New folder” to add a new folder and let’s call it “App” with that folder selected, click “Select Folder” at the bottom. Unity will now generate the Visual Studio project that we’ll use to build and then deploy to our device. Once the project has been generated, open the “App” folder and double-click on the “Origami” solution. To deploy to the device, let’s first set our configuration to “Release”. Set the target to “X86” and then, on the Play menu, pull that down and choose “HoloLens Emulator”. Now, click on Play button to deploy to your HoloLens Emulator. When the emulator loads, you’ll see your scene in the window. Any pixels that show up black here will show the real world on a HoloLens. In this chapter, we saw how to make our scene holographic, how to add objects to the scene that will appear as holograms, and how to deploy that scene to our device emulator. In the next chapters, we’re going to figure out how to add interactivity to the objects by using Gaze, Gesture, and Voice.

Author:

Leave a Reply

Your email address will not be published. Required fields are marked *