HoloLens 技術情報の作業過程記録 - HoloLens Documentation: Holograms 100
Install the tools に続いて、Using Visual Studio を確認したところ、下記の下準備が必要であることを確認。
Prerequisites
- See Install the Tools for installation instructions.
- Create a new Universal Windows app project in Visual Studio 2015 Update 1 for a 2D Windows 10 app or start use Unity to create a holographic app. C#, C++, and JavaScript projects are all supported on HoloLens.
この記事は、2. の use Unity to create a holographic app (a.k.a Holograms 100) の作業過程記録です。
- Target the app to Windows.Holographic新しいプロジェクトの作成 (Chapter 1 - Create a New Project の実施)
- Start Unity
- Select New
- Enter a project name (e.g. "HelloHolograms")
- Enter a location to save your project
- Ensure the 3D toggle is selected
- Select Create project
- Chapter 2 - Setup the Camera の実施
- Select Main Camera in the Hierarchy panel
- In the Inspector panel, find the Transform component and change the Position from (X: 0, Y: 1, Z: -10) to (X: 0, Y: 0, Z: 0)
※規定値は (X: 0, Y: 0, Z: -10) だった
- Chapter 2 - Setup the Camera の実施
- With the Main Camera still selected in the Hierarchy panel, find the Camera component in the Inspector panel and change the Clear Flags dropdown from Skybox to Solid Color.
- Select the Background color picker and change the RGBA values to (0, 0, 0, 0)
- Chapter 2 - Setup the Camera の実施
- With the Main Camera still selected in the Hierarchy panel, find the Camera component in the Inspector panel and change the Near Clip Plane field from the default 0.3 to the HoloLens recommended 0.85.
- Chapter 3 - Create a Hologram の実施
- In the top left corner of the Hierarchy panel, select the Create dropdown and choose 3D Object > Cube.
- Select the newly created Cube in the Hierarchy panel
- In the Inspector find the Transform component and change Position to (X: 0, Y: 0, Z: 2). This positions the cube 2 meters in front of the user's starting position.
- In the Transform component, change Rotation to (X: 45, Y: 45, Z: 45) and change Scale to (X: 0.25, Y: 0.25, Z: 0.25). This scales the cube to 0.25 meters.
- To save the scene changes, select File > Save Scene, name the scene, and select Save
- In the top left corner of the Hierarchy panel, select the Create dropdown and choose 3D Object > Cube.
- Chapter 4 - Export from Unity to Visual Studio の実施
- Chapter 4 - Export from Unity to Visual Studio: Unity build settings の実施
- Chapter 4 - Export from Unity to Visual Studio: Specify the export for Windows Holographic
- From the Build Settings... window, open Player Settings...
- Select the Settings for Windows Store tab
- Expand the Other Settings group
- In the Rendering section, check the Virtual Reality Supported checkbox to add a new Virtual Reality Devices list and confirm "Windows Holographic" is listed as a supported device.
Virual Reality Supported チェックボックスが見当たらない...
unity は Version 5.3.1f1 PersonalInstall the tools を確認。
unity を更新してみる。
unity の Help からは更新できず。Unity - Windows - HoloLens から Unity Download Assistant をダウンロード。
Unity の更新。このPC から更新していなかったかな...
Unity フォルダとは別に、Unity HoloLens 5.4.0f3-HTP のフォルダができた。このフォルダ内の Unity.exe を起動する
一度保存することで、Unity version: 5.4.0 で保存できた。
Virtual Reality Supported 項目を確認できた。
- Chapter 4 - Export from Unity to Visual Studio: Export the Visual Studio solution
- Return to the Build Settings window.
- Click Add Open Scenes to add the scene
- Check Unity C# Projects
- Click Build
- Click New Folder and name the folder "App".
- With the App folder selected, click the Select Folder button.
- When Unity is done building, a Windows File Explorer window will appear.
- Open the App folder in File Explorer.
- Open the generated Visual Studio solution (HelloHolograms.sln in this example)
- Chapter 4 - Export from Unity to Visual Studio: Target the app to Windows.Holographic
- In Visual Studio, right click on Package.appxmanifest in the Solution Explorer and select View Code
Visual Studio で開くと上記確認画面。
開発者モードに変更した。 - Find the line specifying TargetDeviceFamily and change Name="Windows.Universal" to Name="Windows.Holographic".
- On the same line, change MaxVersionTested="10.0.10240.0" to MaxVersionTested="10.0.10586.0"
- Save the Package.appxmanifest.
- In Visual Studio, right click on Package.appxmanifest in the Solution Explorer and select View Code
- Chapter 5 - Export from Unity to Visual Studio: Chapter 5 - Build and Deploy
- Using the top toolbar in Visual Studio, change the target from Debug to Release and from ARM to X86.
-
HoloLens over USB
- Click on the arrow next to the Local Machine button, and change the deployment target to Device.
- Select Debug > Start without debugging
2つエラー
重大度レベル コード 説明 プロジェクト ファイル 行 抑制状態
エラー The OutputPath property is not set for project 'Assembly-CSharp.csproj'. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration='Debug' Platform='AnyCPU'. This error may also appear if some other project is trying to follow a project-to-project reference to this project, this project has been unloaded or is not included in the solution, and the referencing project does not build using the same or an equivalent Configuration or Platform. HelloHolograms
重大度レベル コード 説明 プロジェクト ファイル 行 抑制状態
エラー The OutputPath property is not set for project 'Assembly-CSharp-firstpass.csproj'. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration='Debug' Platform='AnyCPU'. This error may also appear if some other project is trying to follow a project-to-project reference to this project, this project has been unloaded or is not included in the solution, and the referencing project does not build using the same or an equivalent Configuration or Platform. HelloHologramsvisual studio 2008 - "the outputpath property is not set for this project" error - Stack Overflow
重大度レベル コード 説明 プロジェクト ファイル 行 抑制状態
エラー ファイル "C:\Users\Public\Documents\Unity Projects\HelloHolograms\UWP\Assembly-CSharp\bin\x86\Release\Assembly-CSharp.dll" は見つからなかったためコピーできません。 HelloHolograms C:\Users\Public\Documents\Unity Projects\HelloHolograms\App\HelloHolograms\HelloHolograms.csproj 241
重大度レベル コード 説明 プロジェクト ファイル 行 抑制状態
エラー コマンド ""C:\Users\Public\Documents\Unity Projects\HelloHolograms\App\Unity\Tools\AssemblyConverter.exe" -platform=uap -lock="C:\Users\Public\Documents\Unity Projects\HelloHolograms\App\HelloHolograms\project.lock.json" -bits=32 -configuration=Release -removeDebuggableAttribute=False -path="." -path="..\Players\UAP\x86\Release" "C:\Users\Public\Documents\Unity Projects\HelloHolograms\App\HelloHolograms\Assembly-CSharp.dll" "C:\Users\Public\Documents\Unity Projects\HelloHolograms\App\HelloHolograms\Assembly-CSharp-firstpass.dll" "C:\Users\Public\Documents\Unity Projects\HelloHolograms\App\HelloHolograms\UnityEngine.dll" "C:\Users\Public\Documents\Unity Projects\HelloHolograms\App\HelloHolograms\UnityEngine.UI.dll" "C:\Users\Public\Documents\Unity Projects\HelloHolograms\App\HelloHolograms\UnityEngine.HoloLens.dll" "C:\Users\Public\Documents\Unity Projects\HelloHolograms\App\HelloHolograms\UnityEngine.Networking.dll" "C:\Users\Public\Documents\Unity Projects\HelloHolograms\App\HelloHolograms\UnityEngine.VR.dll"" はコード 1 で終了しました。 HelloHolograms C:\Users\Public\Documents\Unity Projects\HelloHolograms\App\HelloHolograms\HelloHolograms.csproj 252
あれこれやったが、うまくいかない。バージョンが違うのに進めたせいか。再度作りなおすか。
Unity が Version 5.4.0f3-HTP Personal であることを確認のうえ、上記手順を再度実行。
できた。
Hololens [Setings] - [UPDATE&SECURIY] - [For developers] - [Pair] で確認した PIN を入力
- Click on the arrow next to the Local Machine button, and change the deployment target to Device.
-
Try out your app
Now that your app is deployed, try moving all around the cube and observe that it stays in the world in front of you.
HoloLens でキャプチャーしたDemo (Holograms のみ)HoloLens でキャプチャーしたDemo (Holograms + PV camera)
youtu.be
HoloLens のキャプチャー方法は参考情報を参照
参考情報: