Hololens2和Vuforia连用之unity2019平台

 此平台的组合为:unity2019+vuforia9.8

建议用2020+vuforia10.2平台,不要用此平台。因当前最新的vuforia10.2不支持unity2019。可vuforia10.2确实是最好用的,包括比例设置和稳定性。

所以本文就大概写一下,详细的还是参看2020那篇。

  1. Create a new Unity Project. 
  2. Switch build platform to UWP.
  3. Click the Player Settings -> XR Plugin Management, and install the latest XR Management package and enable the Windows Mixed Reality under Plug-in Providers.
  4. Import MRTK and Vuforia 
    1. Download the *.unitypackage for the MRTK here. Select the Microsoft.MixedReality.Toolkit.Unity.Foundation. The other packages are optional.
    2. Download the *.unitypackage for the Vuforia Engine here. 
  5. Go to Assets -> Import Package -> Custom Package and import the MRTK and Vuforia packages. 
  6. In the File menu, select Build Settings.
  7. Select Player Settings and expand the Publishing Settings section.
    • Under Capabilities ensure that Internet ClientWebCamMicrophone, and SpatialPerception are selected.
      NOTESpatialPerception should only be selected if you intend to use the Surface Observer API.
    • Under Supported Device Families, ensure that Holographic is selected. 
  8. Expand the Resolution and Presentation section.
    • Disable Run in Background so that Vuforia pauses when the app is put into the background and can access the camera again when the app is resumed.
    • In the Default Orientation dropdown, ensure that Landscape Left is selected.
  9. Close the Project Settings window.
  10. Add the MRTK to each scene using Mixed Reality Toolkit > Add to Scene and Configure
  11. In the MixedRealityToolkit GameObject, in each scene, set the configuration profile to the DefaultHoloLens2ConfigurationProfile.
  12. Select the Main Camera found as a child of the MixedRealityPlaySpace GameObject and add the VuforiaBehaviour component to it.
  13. Vuforia engine安装好的菜单位置Hololens2和Vuforia连用之unity2019平台_第1张图片

Vuforia engine版本安装后的确认 Hololens2和Vuforia连用之unity2019平台_第2张图片

Main camera方式 Hololens2和Vuforia连用之unity2019平台_第3张图片

Camera中Open Vuforia engine configuration Hololens2和Vuforia连用之unity2019平台_第4张图片

 Vuforia上传image尺寸设置0.21Hololens2和Vuforia连用之unity2019平台_第5张图片

 Vuforia上传image成功后

Hololens2和Vuforia连用之unity2019平台_第6张图片

Image target选择后的默认比例(不能改,width事关x,改此一个其它会立马自动全改的,为何我传的是0.21这里调入后确实0.3263,还不能改动,否则识别不正常,这样会影响我对最终位置关系的判断,这是我放弃此组合的原因。)Hololens2和Vuforia连用之unity2019平台_第7张图片Cube设置

Hololens2和Vuforia连用之unity2019平台_第8张图片 因比例连城的关系,方块眼镜中看到的实际大小为0.5*0.3263,位置关系不变,在纸张的表面。

你可能感兴趣的:(hololens,2,unity2019,vuforia9.8,hololens2)