Head Mounted Display (HMD)

From ETC Public Wiki
Jump to: navigation, search

Note: "Documentation" sections are articles that tell of the problems, solutions, and methods behind implementing a piece of hardware into Unity.

Development Status

Integration Difficulty: Was done. Very hard to do and isn't working well. Unity fights most of the things that would make it work like the DLL for Urph and C# messaging.

Integration Completeness: All info is in but it is not stable.

End-product Ease-of-use: Insanely easy to implement. All one needs to do is drag and drop classes and run all programs.


  1. Found VRPNNET.dll for C# online.
  2. Attempted running VRPNNET.dll within Unity and received "Native code" errors.
  3. Found a solution for fixing said errors: Compile directly down to the X86 compiler (Note: That option is only available in Monodevelop and not Unity)
  4. No other implementation options for VRPN in Unity as of now.
  5. Wrote server to stream data from the VRPN server to Unity.
  6. Found errors sending raw data over so that data is generated into XML. This is then serialized and sent over a TCP network to be deserialized within Unity.
  7. Code then ran too slow within Unity's update loop so a thread within Unity to handle server transfer data was created.
  8. HMD data is stored in a raw pool of HMD data that is yanked by scripts written for each tracker.
  9. Changed thread processes to a fixed timestep with an update set at 0.008.


  1. Turn on VRPN server with HMD connected to the computer.
  2. Turn on HMDStreamer server.
  3. Drag and drop hmd.cs onto the main camera.
  4. Drag and drop redtracker.cs, yellowtracker.cs, greentracker.cs, or bluetracker.cs onto the objects you want to move with corresponding tracker.
  5. For an accurate HMD setup, create the following structure:
----Head (redtracker.cs)
----MainCamera (hmd.cs)
6. In edit -> project settings -> time, set the fixed timestep to 0.008 (See Figure 1) File:HardwareDocumentation1.png


Below is the HMD Sample, HMD Streamer, and VRPN Server

HMD Sample Project and Servers
Pohlhemus Liberty Tracker Drivers

Youtube Videos:
HMD Simple Demo
HMD Show Demo

Vimeo Videos:
HMD Simple Demo
HMD Show Demo