hololens和unity

主要参考的微软官网的教程,汉语版的介绍的都太粗糙,不好用。gaze, gesture,代码交互。参看https://docs.microsoft.com/zh-cn/windows/mixed-reality/holograms-101e
在这里插入图片描述在这里插入图片描述Instructions
Start Unity.
Select Open.
Enter location as the Origami folder you previously un-archived.
Select Origami and click Select Folder.
Save the new scene: File / Save Scene As.
Name the scene Origami and press the Save button.
Setup the main camera
In the Hierarchy Panel, select Main Camera.
In the Inspector set its transform position to 0,0,0.
Find the Clear Flags property, and change the dropdown from Skybox to Solid color.
Click on the Background field to open a color picker.
Set R, G, B, and A to 0.
Setup the scene
In the Hierarchy Panel, click on Create and Create Empty.
Right-click the new GameObject and select Rename. Rename the GameObject to OrigamiCollection.
From the Holograms folder in the Project Panel:
Drag Stage into the Hierarchy to be a child of OrigamiCollection.
Drag Sphere1 into the Hierarchy to be a child of OrigamiCollection.
Drag Sphere2 into the Hierarchy to be a child of OrigamiCollection.
Right-click the Directional Light object in the Hierarchy Panel and select Delete.
From the Holograms folder, drag Lights into the root of the Hierarchy Panel.
In the Hierarchy, select the OrigamiCollection.
In the Inspector, set the transform position to 0, -0.5, 2.0.
Press the Play button in Unity to preview your holograms.
You should see the Origami objects in the preview window.
Press Play a second time to stop preview mode.
Export the project from Unity to Visual Studio
In Unity select File > Build Settings.
Select Windows Store in the Platform list and click Switch Platform.
Set SDK to Universal 10 and Build Type to D3D.
Check Unity C# Projects.
Click Add Open Scenes to add the scene.
Click Player Settings…
In the Inspector Panel select the Windows Store logo. Then select Publishing Settings.
In the Capabilities section, select the Microphone and SpatialPerception capabilities.
Back in the Build Settings window, click Build.
Create a New Folder named “App”.
Single click the App Folder.
Press Select Folder.
When Unity is done, a File Explorer window will appear.
Open the App folder.
Open the Origami Visual Studio Solution.
Using the top toolbar in Visual Studio, change the target from Debug to Release and from ARM to X86.
Click on the arrow next to the Device button, and select HoloLens Emulator.
Click Debug -> Start Without debugging or press Ctrl + F5.
After some time the emulator will start with the Origami project. When first launching the emulator, it can take as long as 15 minutes for the emulator to start up. Once it starts, do not close it.
在这里插入图片描述在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_44345862/article/details/85466566