Documentation (ENG)
  • Setup Guide
  • Getting Started
    • Prerequisites
    • VPS Map Coverage
  • 3D Object
    • 3D Object Placement
  • Unity Scene
    • Unity Scene Components
  • Scene Manager
    • SceneManager Description
  • Samples
    • AR Navigation
    • Placement by Raycast
  • NReal
    • Nreal Support
  • API Reference
Powered by GitBook
On this page
  • Nreal Unity SDK Download
  • MAXST VPS Unity SDK for Nreal Glasses Download
  • Unity Scene Components
  • SceneManager Components
  • Nreal Camera Start/ VPS Tracker Start
  • Get result for VPS Tracker
Export as PDF
  1. NReal

Nreal Support

PreviousPlacement by RaycastNextAPI Reference

Last updated 3 years ago

Nreal Unity SDK Download

In order to support Nreal Glasses, Nreal Unity SDK is required. click 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 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);
    }
}

SceneManager Description
here
here
Unity Scene Components
Unity Scene Hierarchy for Nreal Glasses
SceneManager Components for Nreal