Skip to content

CIVA-Lab/Tutorial-Unity_with_UniCAVE

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Tutorial - Unity with UniCAVE

Requirements

  1. Unity 2019.3.5 version

  2. Download UniCAVE plugin

    https://widve.github.io/

  3. Download UniCAVE 2019 on CAVE machine

Unity Project setup

Import package

Go to Package→UniCAVE Plugin→Prefabs, drag and drop Default Network Manager to the scene.

Import the prefab file below

M4_Seq_4Displays_1PC_mosaic_crop.prefab

Now, the scene is like:

Untitled

Display, Head, Wand, Input Setup

Display

Go to Assets area, right click and create new MachineName Assets and set name as VISCUBE

Untitled

Also set the name here

Untitled

  1. Select Displays under M4_Seq_4Displays_1PC_mosaic_cropDisplays

  2. Go to Inspector

    Untitled

  3. Create Physical Display Manager and se machine Name as the MachineName Asset

    Associated Displays will be setup automatically once the different displays setup.

  4. Select Front Wall and go to Inspector

    Untitled

    Add Component Physical Display and select Manager as Displays

    For the Head, once setup Head, then go back to here to set Head

    For other values, we can import them from JSON files.

    Display_settings.zip

    Do the same thing for Floor, Left Wall, and Right Wall

  5. Go to Head

    Untitled

    set the value as the image above.

  6. Go to Wand

    Remove the empty script (otherwise, it may cause the frozen.)

    Add a new component VRPN Track and change Tracker Address and Channel =1

  7. Go to Input

    remove empty script, create VRPN Input, and set as below

    Untitled

    For other features, free to change.

  8. Go to Default Network Manager , and add Network Initialization

    Untitled

    Remember to change Server Address to 192.168.0.2

Change Clipping Panel

Go to M4_Seq_4Displays_1PC_mosaic_cropHead

Change the Far Clipping Plane to 1000000 (a big number)

Add VR Support

Go to Edit → Project Settings → Player

Under XR Settings enable Virtual Reality Supported

Add Stereo Display (non head-mounted) to SDK

Remove others SDKs

Edit VRPN script

Go to Packages → UniCAVE Plugin → Scripts → VRPN

Edit VRPN.CS file

Replace the following code

//todo - need to allow different transforms here...
//need to adjust two below functions to match up with your own tracking system's transform
public static Vector3 vrpnTrackerPos(string address, int channel)
{
    return new Vector3(
				(float)vrpnTrackerExtern(address, channel, 0, Time.frameCount),
        (float)vrpnTrackerExtern(address, channel, 1, Time.frameCount),
        -(float)vrpnTrackerExtern(address, channel, 2, Time.frameCount));
}

public static Quaternion vrpnTrackerQuat(string address, int channel)
{
    return new Quaternion(
				(float)vrpnTrackerExtern(address, channel, 3, Time.frameCount),
        (float)vrpnTrackerExtern(address, channel, 4, Time.frameCount),
        -(float)vrpnTrackerExtern(address, channel, 5, Time.frameCount),
        -(float)vrpnTrackerExtern(address, channel, 6, Time.frameCount));
}

Build

After setup, go to File → Build Setting..., and build it. and save it to a USB

Run the project - CAVE Machine

  1. Turn on the Projector by double click PROJS_ON.sh
  2. Open DTrack2, connect
  3. Turn on VRPN Server
    1. go to folder on Desktop/visbox/apps/UniCAVE2019
    2. double click vrpn_server.exe
  4. Copy the project folder to /UniCAVE2019
  5. Copy the paul2019_force_gpu.ps1 to the project folder
  6. Edit the ps1 file
    1. Change the executable file to the unity project exe file.
    2. Change the name of the log file

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published