Setting up Hololens MRTK 2.0 with Vuforia in Unity 2019.1

馋奶兔 提交于 2021-02-08 05:42:53

问题


I'm developing a Unity app for the Hololens 1 that uses Vuforia. Unfortunately, I cannot get the camera to work with Vuforia, it remains frozen in place and does not follow head movement. When I disable Vuforia, the camera tracks fine.

My setup is as follows: * Windows 10 * Unity 2019.1.4f1 * MRTK v2.0.0 RC2 * Vuforia 8.1.11

I tried following the steps outlined here: https://github.com/Microsoft/MixedRealityToolkit-Unity/issues/1461#issuecomment-373714387

To no avail. I also tried having both cameras active, same result. The Vuforia Hololens sample that can be found in the Unity asset store is severely outdated (using the old Holotoolkit, not MRTK), so it is not very useful to me. I noticed that older versions of Vuforia allow the script on the camera to be set to "world center": "camera", but this option is now forced to "device" when Vuforia is configured for the hololens.

Can anyone tell me how to properly configure my scene for MRTK 2 and Vuforia? I'd be eternally grateful for a link to an up to date example project.

EDIT: This seems to be an issue only when using Unity's holographic remote. I would still very much like to resolve that though, since deploying is very time-consuming and makes debugging almost impossible.


回答1:


This worked for me: Import MRTK package and add it to the scene. This will create a MainCamera under MixedRealityPlayspace Game Object. Then GameObject > VuforiaEngine > ARCamera. This will create an ARCamera with two components: Vuforia Behavior and Default Initialization Error Handler. Copy these two components and add them to the MainCamera created when you added MRTK. Finally delete ARCamera. I use Windows 10, Unity 2018.4, MRTKv2.0 and Vuforia 8. Good luck.



来源:https://stackoverflow.com/questions/56557121/setting-up-hololens-mrtk-2-0-with-vuforia-in-unity-2019-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!