Streaming to Unity3D (as of 4.1.2)

NatNet, VRPN, TrackD, and Plugins
Post Reply
woast
Posts: 2
Joined: Mon Apr 01, 2013 1:49 pm
Location: Idaho, US

Streaming to Unity3D (as of 4.1.2)

Post by woast »

Hi there! My name is Jake. I'm a grad-student at the University of Idaho and I would like to make a tutorial series on how to stream Optitrack data into Unity3D. The idea is to have video(s) posted on YouTube before June 2013.

The issue at hand is that as far as scripting/coding goes, I'm incredibly inexperienced. As of right now, I cannot find a simple "how to" video or tutorial on making this bridge (or any solid data feed) into unity for people unskilled in C#. I've played with the scripts posted in this forum as well as those at the Unity site with no success.

I would like to re-examine the two solutions proposed elsewhere on this forum (link below) and assemble a walk through of how specifically the scripts and dlls provided can be utilized in the Unity3D environment.

To get started here, could someone please explain how the three scripts provided on the forum are deployed in Unity?

Arena to Unity

How can the script be utilized to manage a rigid body stream?

What would an example of a script that controls the trans/rot of an object look like?

Thank you for your time, and I look forward to seeing what we can pull together!
Atrexo
Posts: 1
Joined: Tue Apr 02, 2013 6:11 am

Re: Streaming to Unity3D (as of 4.1.2)

Post by Atrexo »

I'm also very interested in this! Perhaps someone could even provide a .unitypackage for us who can't code..?
woast
Posts: 2
Joined: Mon Apr 01, 2013 1:49 pm
Location: Idaho, US

Re: Streaming to Unity3D (as of 4.1.2)

Post by woast »

I've been playing with the three scripts linked above and have formulated a new question. The direct depacetization scripts are geared towards using a skeleton, but what would the script look like if all that was needed was a couple of RigidBodies? How would the implementation script observe the # of rigid bodies and access their pos/rot?
VRDave
Posts: 11
Joined: Mon Mar 04, 2013 11:29 am
Location: Seattle, WA
Contact:

Re: Streaming to Unity3D (as of 4.1.2)

Post by VRDave »

You would still have to handle the case of having incoming skeleton data. You don't have to do anything with it, but you need to acknowledge it exists and then "throw it away".

As far as implementation, we have a rigid body listener script attached to each object in our Unity scene that will be controlled by the incoming data. Then we have a centralized data listener that basically listens for incoming data and sends out a message to the rigid body listener scripts with the new data that has come in.

Our data listener is running asynchronously, however, which means you need to store the data locally on the object and then apply the changes in position and rotation during the Update or FixedUpdate loop depending on if you want physics interactions.
VRcade - Full Motion Virtual Reality
VRcade.com | facebook.com/VRcade
Igor Goncharenko
Posts: 1
Joined: Tue Oct 15, 2013 12:48 am

Re: Streaming to Unity3D (as of 4.1.2)

Post by Igor Goncharenko »

Hello,
I am currently working on skeleton streaming from Arena 1.7.x to Unity (with and without NatNet). Even some successful implementations demonstrated, and there is a basic script by posted Morgan, I would like to to ask the following:
(1) Does NaturalPoint have a plan to issue Unity Plugin in NatNet in the nearest future (in version 2.5, there is no such plugin) ?
(2) Does anybody know successful projects with open code solving Arena/Motive->Unity streaming ?

Thank you in advance,
IG
VRDave
Posts: 11
Joined: Mon Mar 04, 2013 11:29 am
Location: Seattle, WA
Contact:

Re: Streaming to Unity3D (as of 4.1.2)

Post by VRDave »

Hey Igor,
I had issues importing the NatNet SDK dll directly into Unity to use. The errors were something I could not resolve with and older NatNet 2.x, but I have not tried since then. I WAS able to successfully implement my own NatNet/Arena client in Unity using C# and udp sockets. The code is pretty straight forward, but you have to respect the bitstream that comes in from Arena/Motive. (You can find this in the natnet server/client sample).

We now use the latest Unity (4.3 as of today) and Motive. Everything still works as expected and I have had to make minimal changes to my code over the past 8 months. We typically track RigidBodies from Motive/Arena, but my Unity plugin/wrapper also support full skeletal tracking. At some point in the future, we plan to release an SDK for our system, which will include a plugin with Unity wrappers that connect Motive to Unity. Until then, I unfortunately cannot share our code, but hopefully in the near future I can share a free-for-indies dev kit. In the meantime, let me know if you need any guidance, I'd be happy to offer some if I can.

Good Luck!
Dave
Software & Systems Lead
VRcade.com
VRcade - Full Motion Virtual Reality
VRcade.com | facebook.com/VRcade
Post Reply