How to create a simple HoloLens 3D program with Unity

Source: Internet
Author: User

Note: The code example mentioned in this article >how to create a Hello world 3D holographic app with Unity

We've talked about this once. How to create a 2D program in HoloLens, have not seen or forget the classmate can see here recall ^_^

If the last 2D version is a HoloLens mask with a UWP program, then we have to do this is the authentic 3D program OH.

Let's start by looking at what we're going to do.

1. Visual Studio Update 3

2. Windows ten (10.0.10586 version or later)

3. HoloLens Emulator

4. Unity HoloLens Technical Preview

Compared to the last 2D program, we also need a unity HoloLens preview version, links above, the students do not install first. All of our development is basically done with this version of Unity, and this version is special, but it's not going to work if you've already installed unity on your PC, but it's not the same version.

After the preparation is done, the next step is to start the development process.

First of all, we open unity (HoloLens Technical Preview version, Unity is called Unity below), click "NEW" in the upper right corner, fill in Project name and location, select 3D, click Create Project button.

Click File, select Save Scene, enter a file name, save.

Then click Create on the Mainscene and select 3D object->sphere

In order to fit our HoloLens, we need to make some configuration changes.

The first is Maincamera, position is set to the origin (0, 0, 0). Clear Flags Select solid Color, Background select Black #00000000.

The next step is directional light. Reset the transform first, then set the Position-y to 10.

And then the sphere. Set the scale to (0.2, 0.2, 0.2) and position-z to 2.

Finally, we need to turn this project into the solution of VS, and we need to modify some settings.

Select Edit->project Settings->quality,default Select Fastest.

Select File->build Settings, click Add Open Scenes, and select the scene we just created.

In the Platform list, select Windows Store, set the SDK to Universal 10,build Type to D3D, and Tick Unity C # projects. If you don't see these settings in the Windows Store, check that the Unity HoloLens Technical Preview installation is not all selected, and make sure that you install them all in order to do this.

Click Player Settings on the page. Settings for Windows store->other settings-> tick virtual Reality supported

Go back to the Build Settings page, click the Build button, then create a new folder named app in the HelloWorld folder, select the App folder, and click Select Folders.

After Build completes, the HelloWorld folder will open in the file browser, we open the app folder inside, select the SLn file, open with VS2015.

Under the Solution window, right-click the Package.appxmanifest file, select View Code, and change the targetdevicefamily windows.universal to Windows.holographic.

< Dependencies >     <  Name= "windows.holographic"  minversion= "10.0.10240.0"  maxversiontested= "10.0.10586.0"/></Dependencies  >

All modifications are complete. Select Debug,x86,hololens Emulator in the toolbar and click Run.

You can see that in the simulator there is a small ball, through the mouse movement or the arrows to move the simulated walking head and so on, you can see the ball size position changes.

This is the end of our tutorial.

This is just a small 3D program, and if you know something about unity, you can develop more interesting 3D programs to use on HoloLens in the future. We also look forward to seeing more and better 3D apps on the HoloLens.

For more Unity tutorials, please refer to https://unity3d.com/cn/learn/tutorials.

For more holographic tutorials, please refer to Https://developer.microsoft.com/en-us/windows/holographic/academy.

The source code in the text https://code.msdn.microsoft.com/How-to-create-a-Hello-bae9df25.

HoloLens Beginners Tutorial http://www.cnblogs.com/onecodeonescript/p/5885702.html#3514484.

How to create a simple HoloLens 3D program with Unity

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.