![Wooden scale balancing on seesaw.](https://media2.oshyn.com/-/media/Oshyn/Insights/Blog/2024-09-03-Optimizing-Your-AWS-Bill/blog_thumb_optimizing-aws-bill.jpg?h=630&iar=0&w=1200&rev=e54ff19c7e094525a4116b1079eb09eb&hash=26FE361009E9675E19620BF673AB9DDE)
Start Building for HoloLens
![virtual reality globe](https://media2.oshyn.com/-/media/Oshyn/Insights/Blog/HoloLens_QS_hero.jpg?thn=1&w=900&rev=f20f71fb2a0e4b448a9dba65798fed81&hash=FE752EFFC17C9830256BB4D9FCD4F7D1)
![Andres Ayala](https://media2.oshyn.com/-/media/Oshyn/Who-We-Are/Small/aayala.jpg?h=45&thn=1&w=45&rev=54fccd1336ff415a9f2fcde923dab337&hash=5866C242DBE3F88B2C23007EF41492B4)
![calendar icon](/assets/img/calendar.png)
Apr 13, 2017
The tools needed for this project are:
- Unity 5.5.1
- Visual Studio 2015
- To quickly start developing HoloLens apps you can clone a base Unity3D project from our Git.
The project includes Microsoft's HoloToolkit, a collection of scripts and components intended to accelerate the development of holographic applications targeting Windows Holographic. It includes a handful of assets that act as building blocks and the foundation for HoloLens development, you can always tune up this implementation or make your own using the HoloLens API.
-
After cloning the base project, open the root cloned folder with Unity.
-
Find and open the Main scene located on the Assets folder.
The Main scene contains 3 game objects:
- HoloLensCamera
- Managers
- CursorWithFeedback
HoloLensCamera game object is the main camera of the scene. The HoloLens headset renders the scene using this camera field of view and perspective. This object also represents the three-dimensional position and rotation of the user wearing it. For this reason it is often used to track the wearer's movement and position at any given time.
- This camera renders black color (#00000000) as transparent.
- The recommended minimum rendering distance is 0.85 meters.
- For debugging using the unity player, you can emulate the headset movement using keyboard arrow keys for position and mouse for rotation.
"Managers game object" is a collection of game objects that intend to perform as HoloLens API handlers. For example, you can add the InputManager prefab from the HoloToolkit if you want to capture user input gestures such as pinch, hold, hand track, or even speech recognition.
Another interesting manager is the SpatialMapping manager which is embedded in the SpatialMapping game object, this game object uses HoloLens depth sensors in order to create a collection on three-dimensional objects (meshes) in runtime that represent the physical world objects being mapped by the headset.
CursorWithFeedback is another game object from the HoloToolKit that renders a cursor when the camera directly faces a game object composed by a mesh. A clear example is when a user gazes at a spatial surface and the cursor is placed and rotated over the collided point. HoloToolKit provides a few prefab cursors that mimic the ones used on the HoloLens OS.
-
The cloned example is ready to build, go to File > Build Settings. Click on Add Open Scenes and it should bring and tick the Main scene in the Scenes in the Build List.
Select
Windows Store
as target platform, Universal 10 as SDK, HoloLens as target device, D3D as UWP build Type, check Unity C# Projects and Development Build. -
Build the Unity3D project into a new folder named App.
This will create a Visual Studio solution inside the app folder.
-
Open Solution, change the targeting device to Remote Machine and type the HoloLens IP address. If this is the first time you deploy an app to HoloLens, you have to follow the Pairing your device instructions.
Change the deployment build to target x86 and switch to release mode.
Congratulations, you have successfully deployed the Hololens Base app. Now you can start playing around with the different Prefabs and Scene examples.
To learn more check out the Microsoft HoloLens tutorials.
Related Insights
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.