0a  Unity Primitives with Vive VR

smallarrows.GIF

Basic VR with Unity primitives and HTC Vive

Start Unity (You may need to set up an account)
Select NEW
    
Give your project a name such as  0a_Primitive_Tutorial.
          This will create a folder with folders inside.
     Save to the Desktop or your external drive.
     Select 3D.
     Select Create Project.
     Select Allow access to the Firewall pop-up.
Make sure the main view is the
Scene tab.


Add some primitives
The nice thing about primitives is the collision boundaries are already set up.

Choose GameObject->3D Object->Cube etc. Use a Cube for the floor, scale it down in the Y axis.

unity_toolbar
Hand moves view, Move Tool, Rotate Tool, Scale Tool ,Rectangle Select, Move rotate scale tool.

Look at the Inspector tab on the right, Scale should be around 15, .1, 15 x,y,z for the floor cube. (You might need to switch from Services to Inspector.)
Set Position to 0, -.05, 0
You can re-name the floor in the Inspector tab.

Add more primitive shapes, place them above the floor.


Add some materials
Select Assets->Create->Material.
Double click the material in Assets below.
Change the Albedo color in the Inspector on the right.
Drag and drop the material onto the primitive


Scene View Camera
Use the Alt key to move the camera around in the scene.

Click an axis such as X in with the XYZ axis to look down the X axis.
You can toggle between
Persp, Iso and 2D by clicking on the word below the axis.
unity_persp_axis


Import plugin, Steam VR Camera and Controllers for Vive
Choose the
Asset Store tab next to the Scene window

Type SteamVR in the search bar
unity_VR_steam_plugin
Select the
SteamVR Plugin by Valve  (It is free)
If you have never done this select Download first, then Import

Choose Import in the store window (Ignore errors, select I made a backup go ahead)
The Import Unity package window will pop-up, you can downsize the import if you don't want to wait and take up extra disk space. Select Import

Turn off: the file will be 2.73MB compared to 94.4MB
     Longbow
     Readme_InteractionSystem.txt
     Samples
     Materials
     quickstart.pdf
     readme.txt
     Resources
     Scenes
     Textures

Plugins always import into the Assets folder of your project. You can always copy or delete them between projects.

Put the main view window back to Scene instead of Asset Store

     Click the Scene tab on the left


Select the SteamVR folder from the Project tab
Select the arrow, open InteractionSystem, open Core, select Prefabs
Drag the Player into the Hierarchy tab

Unity_steam_primitives1a

Setup the Main Camera to be out of the way
Select the Main Camera from the Hierarchy tab
     Change Target Display to Display 2

     Change Target Eye to None in the Inspector tab
(The main camera interferes with the Vive Headset camera.)


Try your Project with Vive Headset


Hit the Play button   unity_play_arrow


Turn on the hand held controllers, press both small round buttons at the same time, the light will be blue. Put on the headset



If the Vive VR is not working:
Start SteamVR steam_VR1   from the System Tray menu lower right screen. system_tray

Make sure the headset and controllers are connected
Try wiggling the Headset and pressing the buttons on the controllers
Make sure the hand held controllers have charged batteries
unity_steam_status
Steam Status Utility will look like this if it is ready.

Reset Steam if you don't see all the icons
     Select the down arrow next to SteamVR unity_steam_arrow
     Select Devices->Reboot Vive headset
     There is also a menu to Run Room Setup, this should be done already
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::


Add Physics to the primitives
Select all the primitives in the Hierarchy, except the floor,
     note primitives already have colliders
In the Inspector tab: select Add Component->Physics->RigidBody
Do this for every shape that can move with dynamics



Add a Physics Material to make the objects bouncy
Select the  Assets->Create->Physic Material from the menu.
Give the material a name.


Select the Physic Material
change Bounciness to .8

Select the object you would like to adjust the bounciness:
     In the Inspector tab, under Collider, assign the Material

unity_phy_material2



Change the Skybox for all cameras
Choose the
Asset Store tab next to the Scene window

     Type skybox in the search bar, look for free plugins
          (You can select Shop on Old Store under Settings menu unity_settings_store
               this includes a FREE ONLY filter, much better)

     select Download and Import
Put the main view window back to Scene

Choose Window->Rendering->Lighting Settings
     Change the Skybox Material to the skybox you imported, you can also make your own.



Solid Color Background
Turn off the Skybox for individual cameras
Select the Camera, such as CameraRig->Camera (head)->Camera (eye)
Change Clear Flags Skybox to Solid Color in the Inspector
If you want the skybox reflections off, you will need to use Window->Rendering->Lighting Settings


Change the color of the light
     Select the Light in the Hierarchy tab
     Change the Color in the Inspector tab



Fix the shadows on your light
Edit->Project Settings->Quality
     In the Inspector tab
          Change Shadow Resolution to Very High Resolution



Build your project to run on it's own without Unity
(You might need to put your Game Window back to Display 1)
Select File Build Settings
     Select PC, Mac & Linux stand-alone
     Select Build & Run
          Select your Target Platform

          Create a folder
          Save to the folder

Alt F4 exits the player



OBS
OBS screen capture VR documentation