Skip to main content

(4)UnityPlugin

Import of the plugin

  1. Unzip the plugin installation package of "Nokov_Unity_Plugin_XXXX.unitypackage", create a Unity project, click Assets (17.6.1), select "Import package--CustomPackage...", and import the unzipped Unity plugin (17.6.2);
17.6.1

17.6.1

17.6.2

17.6.2

  1. When importing for the first time, there is a red compilation error in the log panel. The warning is to open the project properties and set to allow unsafe code. Check the "Edit->ProjectSettings->Player-Allow Unsafe code" above Unity (17.6.3);
17.6.3

17.6.3


Unity Settings and Usage

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

17.6.4

  1. Click on "Client - Nokov" in the Hierarchy panel, change the Host Ip on the right to 10.1.1.198, expand the Bone Naming Convention (17.6.5, 17.6.6) to make a selection. If you are receiving Markerless human body data, select the "MARKERLESS" option here. If you are receiving other human bodies, select the corresponding option here according to the type of the human body.
17.6.5

17.6.5

17.6.6

17.6.6

  1. Click on "Sapphiart@walk" in the scene, 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 software human body (17.6.7, 17.6.8). Press Enter to save after modification.
17.6.7

17.6.7

17.6.8

17.6.8

  1. Ensure that the Astra professional software is in the playing state, click the play button in Unity, and make the human body in Astra professional move. Then the model in Unity will be driven to perform synchronous movement (17.6.9);
17.6.9

17.6.9

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

17.6.10


Display of named and unnamed points

  1. In Unity, click "Client-Nokov", check the "Draw Unlabeled Markers" checkbox (17.6.11), and then click the "Play" button at the top of the Unity software. Unnamed points will be displayed in the Unity scene.
17.6.11

17.6.11

  1. Check the "Draw Markers" checkbox (17.6.12), and after clicking the "Play" button, the named points of the human body will be displayed in the Unity scene.
17.6.12

17.6.12

  1. After expanding "Client-Nokov", the IDs of named and unnamed points will be displayed in the list. After selecting the ID name of a named or unnamed point in the list, you can view the position of the named or unnamed point in the Unity scene. The XYZ position coordinates of the selected point will be displayed on the right (17.3.13).
17.6.13

17.6.13

  1. Select the scaling ratio in the dropdown box, and select the up - axis in the dropdown box: Click "Client - Nokov", then click "Lenth Unit" on the right to expand the dropdown box and select the scaling ratio (17.6.14). You can choose three units, "meter", "Centimeter", and "Millimeter", to scale the objects in the Unity scene. The default unit is "Meter". Click the "Up Axis" option to expand the dropdown box and select the up - axis in the Unity scene. You can choose two axes, "Y" and "Z", and the default up - axis is "Y".
17.6.14

17.6.14


VRPN controller is connected to Unity

  1. Please first connect the handle and set up motion capture according to the instructions in "XVII. Handle Connection Instructions and VRPN Data Access to UE Instructions" above.
  2. Attach reflective marker points to the object to be captured, and create a rigid body in the real - time mode of the Astra professional software.
  3. Open Unity and create a new project.
  4. Drag the plugin into "Assets" . Please contact our technical engineer to obtain the plugin. Click "Import" to import. After importing, double - click "Demo" in the "Assets--UVRPN--Sences" directory to enter the Unity scene (17.6.15), and switch to "Sence" (17.6.16);
17.6.15

17.6.15

17.6.16

17.6.16

  1. Parameter settings:
    • Set the local address: In "VRPN_Manager", set the address of "Host: (IP/localhost)" to "127.0.0.1" (17.6.17). If you are connecting to another host, change the IP address here to the server IP address of the other host. After setting the IP, press the Enter key and then press Ctrl+S to save.
17.6.17

17.6.17

  • Enable Logging: Enabling logging allows you to view detailed print information when the controller buttons are pressed. Printing error logs can help identify the problem and solve it. Select "Window--General--Console" and check the "Debug Log" (17.6.18);
17.6.18

17.6.18

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

17.6.19

  • Enter the name of the gamepad (joystick1, joystick2) in the "Tracker" input box of the "VRPN_Button (Script)" module, and check "Debug log" to facilitate printing log information (17.6.20). If the first gamepad is connected, enter "joystick1" and press Enter. Here, the "Channel" value represents the number of the corresponding gamepad key position.
17.6.20

17.6.20

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

17.6.21


Real - time driven Tracker

  1. When all the above configurations are set up, 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 "Sence" to display the scene. After moving the rigid body, the objects in Unity will also be synchronously driven. At this time, press the button numbered "1" on the gamepad, and the "Console" in Unity will print the information of the gamepad button positions. "Button 1 Hold" means that button 1 of the gamepad is pressed, and "Button 1 Up" means that button 1 of the gamepad is released after being pressed (17.6.22).
17.6.22

17.6.22

  1. If you need to use other buttons on the gamepad, simply set the "Channel" value in the "VRPN_Button (Script)" module to the corresponding number.
  2. If you use the gamepad wheel, there is no need to set it in "Channel". Just slide the wheel directly, and the "Analog" coordinate values in the "VRPN_Analog (Script)" module will change in real time (17.6.23);
17.6.23

17.6.23

  1. Inversion of Displacement and Rotation: When using a rigidbody to drive objects in a Unity scene in real - time, the displacement and rotation of the rigidbody data can be inverted. In the "VRPN_Tracker (Script)" module, "Position Tracking" represents the displacement of the rigidbody, and "RotationTracking" represents the rotation of the rigidbody. Checking "X, Y, Z" means inverting the coordinate values of the "X, Y, Z" axes (17.6.24).
17.6.24

17.6.24