Into VR » History » Version 6
Hannes Vilhjálmsson, 2019-01-29 17:11
1 | 6 | Hannes Vilhjálmsson | h1. Lab8: Into VR |
---|---|---|---|
2 | 1 | Hannes Vilhjálmsson | |
3 | 4 | Hannes Vilhjálmsson | h2. Goal |
4 | |||
5 | The goal is to try out creating an interactive environment for VR headsets and hand controllers. You will be using the "VRToolkit":https://vrtoolkit.readme.io/, which provides a number of useful building blocks and tons of documentation. |
||
6 | |||
7 | h2. Preparation |
||
8 | |||
9 | Because there are only three computers hooked up to VR devices at CADIA, you will need to follow the procedure on your own machine and testing it first using a simulator rig (comes with the VRToolkit, explained below) and then when you are relatively certain things are working, copy a build of the application to a shared network drive (e.g. \\dfs.ru.is\cadia\Courses\VIEN2017) and then run it on an available VR computer. Therefore you should start by making sure you can access this network drive (get help if you are stuck). |
||
10 | |||
11 | h2. Tutorial Videos |
||
12 | |||
13 | The procedure below is more or less covered in these two official VRTK tutorial videos (you do not have to watch them first, you can simply refer to them as needed) |
||
14 | |||
15 | "Working with Multiple SDKs":https://www.youtube.com/watch?v=QwefwHF5E78 |
||
16 | 5 | Hannes Vilhjálmsson | "Pointers, Teleporting and Object Interactions":https://www.youtube.com/watch?v=sW9lxEUXfe8 |
17 | 4 | Hannes Vilhjálmsson | |
18 | h2. Procedure |
||
19 | |||
20 | 1 | Hannes Vilhjálmsson | !http://secom.ru.is/images/into-vr-hierarchy.png! |
21 | |||
22 | |||
23 | 4 | Hannes Vilhjálmsson | |
24 | # *Getting Started* You have to start by importing the following packages: "OculusUtilities":https://developer.oculus.com/downloads/unity/, "OvrAvatar":https://developer.oculus.com/downloads/package/oculus-avatar-sdk/, VRToolkit (from Asset store or from the "VRToolkit Github Repository":https://github.com/thestonefox/VRTK), SteamVR (from Asset store) and Prototyping. You will probably need to delete the Samples folder from OvrAvatar to get rid of some compilation errors. |
||
25 | 1 | Hannes Vilhjálmsson | # *Create Basic Environment* Add a floor with a material that is easy on the eyes. Put a small cube on it (1m tall), as a table, and a small sphere on top of the cube (20 cm diameter). Make the floor and table static and put under a new empty object called Environment. Put the sphere under a new empty object called Props. Add a comfortable ambient sound to the environment to make you feel you entering a different world. |
26 | # *Create Empty VRTK Object Hierarchy* Create 9 Empty Game Objects in the Hierarchy. Arrange and rename them exactly as shown by the lower 9 black and gray objects in the screen shot above (VRTK_SDKManager, SDKSetups, SteamVR, OVR, Simulator, VRTK_Scripts, LeftController, RightController, PlayArea). Make sure the position of all these objects is (0,0,0). Note that they are all still empty! |
||
27 | # *Set Up VR SDK Switching* |
||
28 | 2 | Hannes Vilhjálmsson | ## Add the VRTK_SDK Manager component to the VRTK_SDKManager object. Add the VRTK_SDK Setup component to each of the SteamVR, OVR and Simulator objects. |
29 | 3 | Hannes Vilhjálmsson | ## Do the following to set up the VR Simulator option: |
30 | ### From the VRTK->Prefabs project folder drag VRSimulatorCameraRig under the Simulator game object (as child). |
||
31 | ### In the VRTK_SDK Setup component of the Simulator game object, select Simulator from the QuickSelect drop down. |
||
32 | ## Do the following to set up the SteamVR (HTC Vive) option: |
||
33 | ### From the SteamVR->Prefabs project folder, drag [CameraRig] and [SteamVR] under the SteamVR game object (as children). |
||
34 | ### In the VRTK_SDK Setup component of the SteamVR game object, select SteamVR from the QuickSelect drop down. |
||
35 | ## Do the following to set up the Oculus option: |
||
36 | ### From the OVR->Prefabs project folder drag OVRCameraRig under the OVR game object (as child), |
||
37 | ### From the OvrAvatar->Content->Prefabs project folder drag LocalAvatar under the same OVR game object |
||
38 | ### Select the OVRCameraRig and in the inspector choose Floor Level as the value for Tracking Origin Type |
||
39 | ### Select the LocalAvatar and in the inspector check the Start With Control option (to see the controllers in the world). |
||
40 | ### In the VRTK_SDK Setup component of the OVR game object, select Oculus from the QuickSelect drop down. |
||
41 | ## In the VRTK_SDK Manager component of the VRTK_SDKManager game object, press Auto Populate to see all of the VR setups listed. The list is in the launch order. If something fails to launch, the next setup will be tried. Therefore, you should drag the Simulator setup to the bottom of the list, so it becomes the fallback if no VR equipment is connected. |
||
42 | ## Check the SDK_OCULUS_AVATAR check box in the same VRTK_SDK Manager component. |
||
43 | ## From the VRTK->Prefabs project folder drag the SDKSetupSwitcher under the VRTK_SDKManager as a child. |
||
44 | 1 | Hannes Vilhjálmsson | # *TEST* You should be able to see your scene in any of the VR setups, including the Simulator. You may want to adjust the position of your camera rigs so that you start standing in front of the table. |
45 | # *Making Props Grabbable* Add the following components to a prop you want to grab: |
||
46 | 3 | Hannes Vilhjálmsson | ## Rigidbody |
47 | ## VRTK_Interactable Object (check Is Grabbable) |
||
48 | ## VRTK_Child Of Controller Grab Attach (drag this component also into the Grab Attach Mechanic Script field of VRTK_Interactable Object) |
||
49 | ## VRTK_Outline Object Copy Highlighter |
||
50 | ## VRTK_Interact Haptics (Set Strength On Touch to 1 and Duration On Touch to 0.2) |
||
51 | 1 | Hannes Vilhjálmsson | # *Activating Controllers* Add the VRTK_Controller Events and VRTK_Interact Touch and VRTK_Interact Grab components to both the LeftController and RightController game objects. Select the VRTK_SDKManager game object and drag the LeftController object into the Left Controller field of the VRTK_SDK Manager component and the RightController object into the Right Controller field. |
52 | # *TEST* You should be able to pick up your props. |
||
53 | # *Adding Teleportation* Do the following: |
||
54 | 3 | Hannes Vilhjálmsson | ## To the RightController game object, add the VRTK_Pointer component, |
55 | ## the same RightController game object, add the VRTK_Bezier Pointer Renderer component. |
||
56 | ## Drag the VRTK_Bezier Pointer Renderer component into the Pointer Renderer field of the VRTK_Pointer component. |
||
57 | ## To the PlayArea game object, add the VRTK_Basic Teleport component. |
||
58 | ## Move your camera rig(s) a bit further back from the table, so you can try teleporting towards it. |
||
59 | 1 | Hannes Vilhjálmsson | # *TEST* You should be able to click the touch pad / joystick to make a telaportation arc appear, which takes you to its destination when releasing the pad / joystick. |
60 | # *Go Wild!* Add more props. Try different Grab Attach Mechanics. Try different object highlighters. Fiddle with appearance. |