> For the complete documentation index, see [llms.txt](https://maxstvps.gitbook.io/documentation-eng/-MbEQLJaN0vXKGxXQmJX/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://maxstvps.gitbook.io/documentation-eng/-MbEQLJaN0vXKGxXQmJX/nreal/nreal.md).

# Nreal Support

## Nreal Unity SDK Download

In order to support Nreal Glasses, **Nreal Unity SDK** is required. click [here](https://developer.nreal.ai/download) 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](https://github.com/maxstdev/VPSSDKUnity_NReal) 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**.&#x20;

{% content-ref url="/pages/-MbAzTYswanrpW52lU44" %}
[Unity Scene Components](/documentation-eng/-MbEQLJaN0vXKGxXQmJX/unity-scene/unity-scene.md)
{% endcontent-ref %}

![ Unity Scene Hierarchy for Nreal Glasses](/files/-MbCBBDLFTCKyZ2VOBTd)

\
SceneManager Components <a href="#scenemanager" id="scenemanager"></a>
----------------------------------------------------------------------

ARCamera from SceneManager is replaced with **NRCameraRig Object**

![SceneManager Components for Nreal](/files/-MbCBuE-xvNl5FS0tVcX)

## Nreal Camera Start/ VPS Tracker Start <a href="#nreal-vps" id="nreal-vps"></a>

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

VPSTracker Start can be found in the page below.

{% content-ref url="/pages/-MbAyzG0v5HdHRqYZWvh" %}
[SceneManager Description](/documentation-eng/-MbEQLJaN0vXKGxXQmJX/scene-manager-1/scene-manager.md)
{% endcontent-ref %}

{% code title="NRealSceneManager.cs" %}

```csharp
nRCollectYUV = new NRCollectYUV();
nRCollectYUV.Play();
TrackerManager.GetInstance().StartTracker();

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

{% endcode %}

## Get result for VPS Tracker &#x20;

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.&#x20;

{% code title="NRealSceneManager.cs" %}

```csharp
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);
    }
}
```

{% endcode %}
