Nreal Support

Nreal Unity SDK Download

In order to support Nreal Glasses, Nreal Unity SDK is required. click here to download the SDK. Download Nreal Unity SDK and click Assets/import Package to add onto your project.

MAXST VPS Unity SDK for Nreal Glasses Download

In order to support Nreal Glasses, MAXSTVPS Unity SDK for Nreal Glasses is required. Click here to download the SDK. Click Assets/import Package to add the SDK onto your project.

Unity Scene Components

Unity Scene components for Nreal Glasses are as follows. Detailed information regarding Unity Scene components can be found in the link below. ARCamera from the former Unity Scene is replaced with NRCameraRig.

SceneManager Components

ARCamera from SceneManager is replaced with NRCameraRig Object

Nreal Camera Start/ VPS Tracker Start

‌Play() of Instance from NRCollect YUV starts Nreal Camera.

VPSTracker Start can be found in the page below.

NRealSceneManager.cs
nRCollectYUV = new NRCollectYUV();
nRCollectYUV.Play();
TrackerManager.GetInstance().StartTracker();

if (serverName != "")
{
    string vpsquery = "{\"vps_server\":\"" + serverName + "\"}";
    TrackerManager.GetInstance().AddTrackerData(vpsquery);
}

Get result for VPS Tracker

This is a code for ARFrame Instance from Unity Update(). This is a code to obtain the posture of 6Degrees of Freedom on VPS Map at the time of update and reflect it on the virtual camera for rendering.

NRealSceneManager.cs
void Update()
{
    TrackerManager.GetInstance().UpdateFrame();
    nRCollectYUV.UpdateFrame();
    var eyePoseFromHead = NRFrame.EyePoseFromHead;
    Matrix4x4 Mhe = MatrixUtils.ConvertPoseToMatrix4x4(eyePoseFromHead.RGBEyePos);

    ARFrame arFrame = TrackerManager.GetInstance().GetARFrame();

    if (arFrame.GetARLocationRecognizeState() == ARLocationRecognizeState.ARLocationRecognizeStateNormal)
    {
        Matrix4x4 targetPose = arFrame.GetTransform(Mhe);

        arCamera.transform.position = MatrixUtils.PositionFromMatrix(targetPose);
        arCamera.transform.rotation = MatrixUtils.QuaternionFromMatrix(targetPose);
        arCamera.transform.localScale = MatrixUtils.ScaleFromMatrix(targetPose);

        rootTrackable.SetActive(true);
    }
    else
    {
        rootTrackable.SetActive(false);
    }
}

Last updated