Unity plugin

Import of plugins

Extract the plugin installation package for 'XINGYING_Unity_Plugin_XXXX. unitypackage', create a Unity project, click on Assets (17.6.1), and select 'Import package - CustomimPackage...', Import the extracted Unity plugin (17.6.2);

For the first time importing, there are red compilation errors in the log panel, warning to open project properties, and setting to allow unsafe code. Check the Edit>ProjectSettings>Player Allow Unsafe code above Unity (17.6.3);


Unity settings and usage

Select "Assets Nokov Scenes NokovExample" in the imported installation package and double-click to open it (17.6.4);

Click on "Client Nokov" in the Hierachy panel, modify the Host Ip on the right to 10.1.1.198, and select "XINGYING" (17.6.5, 17.6.6) for skeleton Naming Convention. If the XINGYING software is playing glove human body data, please select "Xing Ying With Hand" for skeleton Naming Convention;

Click on "in the scene Sapphiart@walk ”Ensure that the three modules in the Inspector are checked, and ensure that the name of "Skeleton Asset Name" in "Nokov Skeleton Animation (Script)" is consistent with the name of the human body in XINGYING (17.6.7, 17.6.8). After modification, press Enter to save;

Ensure that the XINGYING software is in a playback state, click the playback button in Unity, and let the human body in XINGYING move. The model in Unity will be driven to perform synchronous motion (17.6.9);

You can switch to the Scene view to observe different angles of the model (17.6.10).


VRPN handle access to Unity

Please first follow the instructions in "17. Handle Connection Instructions and VRPN Data Access UE Instructions" to set up the connection and dynamic capture of the handle;

Attach reflective markers to the captured object and create a rigid body in Live mode using XINGYING software.

Open Unity and create a new project.

Drag the plugin into "Assets" (17.6.11), click "Import" to import, and then double-click "Demo" in the "Assets - UVRPN - Sensors" directory to enter the Unity scene (17.6.12) and switch to "Sense" (17.6.13);

Parameter settings:

  • Set the local address: Set the address of "Host: (IP/localhost)" to "127.0.0.1" (17.6.14) in "VRPN-Manager". If connecting to another host, change the IP address here to the server IP address of the other host. After setting the IP, press Enter and Ctrl+S to save;

  • Turn on log: Turning on the log allows you to see detailed printing information about the pressed button on the handle. Printing the error log can help identify the problem and solve it. Select 'Window General Console' and check 'Debug Log' (17.6.15);

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

  • 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 (17.6.17). 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 (17.6.18).

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 (17.6.19).

  • 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 (17.6.20);

  • 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 (17.6.21).

Last updated