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安装好的菜单位置

Vuforia engine版本安装后的确认 

Main camera方式 

Camera中Open Vuforia engine configuration 

 Vuforia上传image尺寸设置0.21

 Vuforia上传image成功后

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

 因比例连城的关系,方块眼镜中看到的实际大小为0.5*0.3263,位置关系不变,在纸张的表面。

  • 0
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值