此平台的组合为:unity2019+vuforia9.8
建议用2020+vuforia10.2平台,不要用此平台。因当前最新的vuforia10.2不支持unity2019。可vuforia10.2确实是最好用的,包括比例设置和稳定性。
所以本文就大概写一下,详细的还是参看2020那篇。
- Create a new Unity Project.
- Switch build platform to UWP.
- Click the Player Settings -> XR Plugin Management, and install the latest XR Management package and enable the Windows Mixed Reality under Plug-in Providers.
- Import MRTK and Vuforia
- Go to Assets -> Import Package -> Custom Package and import the MRTK and Vuforia packages.
- In the File menu, select Build Settings.
- Select Player Settings and expand the Publishing Settings section.
- Under Capabilities ensure that Internet Client, WebCam, Microphone, and SpatialPerception are selected.
NOTE: SpatialPerception should only be selected if you intend to use the Surface Observer API. - Under Supported Device Families, ensure that Holographic is selected.
- Under Capabilities ensure that Internet Client, WebCam, Microphone, and SpatialPerception are selected.
- 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.
- Close the Project Settings window.
- Add the MRTK to each scene using Mixed Reality Toolkit > Add to Scene and Configure
- In the MixedRealityToolkit GameObject, in each scene, set the configuration profile to the DefaultHoloLens2ConfigurationProfile.
- Select the Main Camera found as a child of the MixedRealityPlaySpace GameObject and add the VuforiaBehaviour component to it.
- 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,位置关系不变,在纸张的表面。