Unity2020 LTS version, Vuforia9.8.8, MRTK 2.7.2 are all current at the time of writing

MTRK toolkit

Docs.microsoft.com/en-us/windo…Complete steps 1 and 2

Import the Vuforia

Vuforia set

developer.vuforia.com/

Create a new key

In Unity, Hierarchy right-click and create a Vuforia Camera (ARCamera) Camera with Background changed to Solid Color black. Copy the App License on the Vuforia website Paste the Key into Vuforia Behaviour

After creating, click enter

Download and import it directly from Unity. It is a Unity package

Settings in Unity

This is where you put a model on top of the image for the Unity package you just imported

Focus script

using UnityEngine;
using Vuforia;
 
public class FrameRateSettings : MonoBehaviour
{
    void Start()
    {
        VuforiaARController.Instance.RegisterVuforiaStartedCallback(OnVuforiaStarted);
        VuforiaARController.Instance.RegisterOnPauseCallback(OnPaused);
    }
 
    private void OnVuforiaStarted()
    {
        // Query the frame rate and unity recommended by Vuforia
        int targetFps = VuforiaRenderer.Instance.GetRecommendedFps(VuforiaRenderer.FpsHint.NONE);
 
        / / by default, we use the Application. The frame frequency targetFrameRate Settings suggestion.
        // Google Cardboard does not use vsync, the OVR explicitly disables it. If developers
        / / use vsync in its quality Settings, they should also set its QualitySettings. VSyncCount
        // Based on the value returned above.
        // For example: if targetFPS> 50-> vSyncCount = 1; Otherwise vSyncCount = 2;
        if(Application.targetFrameRate ! = targetFps) { Debug.Log("Setting frame rate to " + targetFps + "fps");
            Application.targetFrameRate = targetFps;
        }
        
        // Enable the autofocus mode
        CameraDevice.Instance.SetFocusMode(
            CameraDevice.FocusMode.FOCUS_MODE_CONTINUOUSAUTO);
            
    }
 
    private void OnPaused(bool paused)
    {
        if(! paused) {//// recovery
            //// Set autofocus mode to resume when appliedCameraDevice.Instance.SetFocusMode(CameraDevice.FocusMode.FOCUS_MODE_CONTINUOUSAUTO); }}}Copy the code

Camera Setup (laptop and desktop)

For a computer with a camera, it can be used directly

For computers without a camera, use the phone’s camera (economise)

Using this software: link: pan.baidu.com/s/1rLEvLaPx… Extract code: PPR6

Packaging set

Incorrect Settings in this section will cause the deployment to Hololens2 to be unresponsive or even unable to be deployed

Docs.microsoft.com/zh-cn/windo…

Common mistakes

1 Failed to use universal authentication…..

Solution (most likely usb connection is not installed)

2 the lack of PDB

The solution

. Don’t know yet

3. Incorrect display of model position

  • 1. The Vuforia identification map must be the same size as the actual printed identification map when uploaded. For example, if the actual size is 10cm, then the upload width should be set to 0.1 (Unity uses meters).
  • 2. ARcamera position must be set to (0,0,0).

Other problems with the model not showing, either it’s showing but not on the identifier, so you can’t see it. Either that or there is a problem with the process you post to Hololens. Maybe you forgot to check an option.

4. The model does not disappear after it appears

Make the change here, which is the script that comes with ImageTarget

5 During deployment: SDK “WindowsMobile, Version=10.0.18362.0” cannot be found.

6. After packing, only the left eye appeared

When using Hololens 2 to display the Shader you wrote, there is an issue with the upload that only the left eye can see, but not the right eye.

7. Hololens grey in OpenXR

Re-install OpenXr, chances are that it was not installed or accidentally deleted by you

8 Activate the Template3D_pzq3xp76mxafg! “App” failed with error “access denied”

Hololens is not unlocked. It’s gone

9 Failed to read the local file

From what I’ve seen so far, it looks like reading is only supported in the hololens2 folders

Tick permissions

Json parsing

Using simplejson

The demo with the demo

link