Unity Plugin
Ⅰ. Importing Plugins
- Open the Unity project, click "Assets — Import Package — Custom Package...", and select the "Nokov_Unity_Plugin xxx.unitypackage" plugin to open it;

- Click "Import".

- The first time you import, there may be red compilation errors in the log panel. To fix this, open the project properties and set it to allow unsafe code. Check Edit > Project Settings > Player and enable "Allow Unsafe Code";
.png)
Ⅱ. Unity settings and usage
- Select "Assets > NOKOV > Scenes > NOKOVExample" in the imported installation package and double-click to open it;

- Click "Client - Nokov" in the Hierarchy panel, change the Server Ip on the right to the IP address broadcast by the XINGYING software, and select "XINGYING" for Bone Naming Convention. If you want to receive human body data with data gloves, please select "Xing Ying With Hand" in Bone Naming Convention;

- Click on "Sapphiart@walk" in the scene. Ensure that the three modules in the Inspector are checked, and that the name of the "Skeleton Asset Name" in "NOKOV Skeleton Animation (Script)" matches the name of the human body in XINGYING. After making modifications, press Enter to save.

-
Ensure that XINGYING software is in playback mode, then click the playback button in Unity to let the human body in XINGYING move. The model in Unity will then perform synchronous motion.
-
You can switch to the Scene view to observe the model from different angles.

Ⅲ. Display of Named and Unnamed Points
- In Unity, click on "Client-NOKOV" and check the "Draw Unlabeled Markers" checkbox. Then click the "Play" button at the top of the Unity software, and unnamed points will be displayed in the Unity scene.
.png)
- Check the "Draw Markers" checkbox, then click the "Play" button, and the named points of the human body will be displayed in the Unity scene.
.png)
- After expanding "Client-NOKOV," the list will show the IDs of both named and unnamed points. After selecting the ID name of a named or unnamed point from the list, you can view the position of the named or unnamed point in the Unity scene, and the XYZ coordinates of the selected point will be displayed on the right.
.png)
- Dropdown to Select Scale Ratio, Dropdown to Select Up Axis: Click on "Client-NOKOV," and on the right side, click on "Length Unit" to expand the dropdown and select the scale ratio. You can choose among "meter, Centimeter, Millimeter" for scaling objects in the Unity scene, with the default unit being "Meter." Click on the "Up Axis" option to expand the dropdown box where you can choose the up axis for the Unity scene, with the options being "Y, Z." The default up axis is "Y."
.png)
Ⅳ. Helen Hayes human-driven model
-
Create a Unity project and import the "Nokov_Unity_Plugin_xxx_HelenHayes.unitypackage" plugin. Please refer to the previous section "Plugin Import" for instructions on importing the plugin.
-
Click Client - Nokov, then configure "Server IP" on the right to match the SDK network card address in XINGYING. The coordinate system of the HelenHayes template uses the Z-axis as up. Set "Up Axis" to Z-Up and "Bone Naming Convention" to HelenHayes.

- Click Sapphiart@walk, and enter the name of the Helen Hayes dynamic template from the XINGYING software in "Skeleton Asset Name".

-
Make sure XINGYING has started playing, then click the Play button in Unity.
-
Click the "MarkTpose" button in Unity, and the model will start motion synchronization.

Ⅴ. Rigid-body Data-driven Cube Model
-
Play after creating rigid bodies in XINGYING.
-
Click "Client - Nokov" in the Hierarchy panel, and change the Server Ip on the right to the IP address broadcast by the XINGYING software.
-
The Unity plugin comes with three built-in Cube models (Cube1, Cube2, Cube3) in the Hierarchy panel. Select one of them (e.g. Cube1), and you can view its properties and settings in the Inspector panel.
-
Enter the name of the XINGYING rigid body in "Rigid Body Name". If multiple rigid bodies are used to drive multiple Cubes, change the "Rigid Body Name" of other Cubes to the corresponding rigid body names.

- Click the Play button in Unity, and the Cube model in the scene will be driven by rigidbody data to move synchronously.
Ⅵ. Connect Nokov Controller to Unity
- Please first connect the controller and set up motion capture in accordance with the instructions in the above document "Controller Connection Instructions and VRPN Data Access to UE Instructions";
- Attach reflective markers to the object to be captured and create a rigid body in Live mode using XINGYING software.
- Open Unity and create a new project.
- Please contact our technical engineer to obtain the "UVRPN_V_xxx_Source.unitypackage" plugin. After obtaining it, drag the plugin into "Assets" and click "Import". Once imported, double-click "Demo" in the path "Assets——UVRPN——Scenes" to enter the Unity scene, then switch to "Scene".

Parameter settings
- Set the local address: Select "VRPN_Manager" in the Hierarchy panel. In the Inspector panel on the right, set the address of "Host: (IP/localhost)" to "127.0.0.1". If connecting to another host, change the IP address here to the server IP address of that host. After setting the IP, press Enter and save with Ctrl+S;

- Turn on logging: Enabling logging allows you to see detailed information about the pressed buttons on the handle. Printing the error log can help identify and resolve issues. Select 'Window > General > Console' and check 'Debug Log'.

- Set Flystick: Click on "Flystick" and enter the name of the rigid body created by XINGYING software in the "Tracker" input box in the "VRPN_Tracker (Script)" module. Set "Channel" to 0 and press Enter to save.

- In the "Tracker" input box of the "VRPN_Button (Script)" module, enter the name of the handle (joystick1, joystick2), check "Debug log" to facilitate printing of log information. If the first handle is connected, enter "joystick1" and press the Enter key. The "Channel" value here represents the number of the corresponding handle key position.

- Enter the name of the handle (joystick1, joystick2) in the "Tracker" input box of the "VRPN_Analog (Script)" module, and set "Channel" to 0.

Real-time Drive Tracker
- After all the above configurations are set, set the "Channel" value in the "VRPN_Button (Script)" module to 1, press the Enter key to save the configuration, click Play to switch to "Sense" to display the scene, and after moving the rigid body, the objects in Unity will also be synchronously driven. At this time, press the button numbered "1" on the handle, and the "Console" in Unity will print the information of the handle key position, Button 1 Hold "indicates that button 1 of the handle is pressed, and" Button 1 Up "indicates that button 1 of the handle is released after being pressed.

-
If you need to use other buttons on the handle, set the "Channel" value to the corresponding number in the "VRPN_Button (Script)" module.
-
If a handle wheel is used, there is no need to set it in the "Channel". Simply slide the wheel and the "Analog" coordinate value in the "VRPN_Analog (Script)" module will change in real time;

- Inversion of displacement and rotation: When using a rigid body to drive objects in a Unity scene in Live, the displacement and rotation of the rigid body data can be reversed. In the "VRPN_Tracker (Script)" module, "Position Tracking" represents the displacement of the rigid body, "RotationTracking" represents the rotation of the rigid body, and checking "X, Y, Z" represents the inversion of the coordinate values of the "X, Y, Z" axes.
