devNotes 6-12-16 VR lab, sound and partSys interfaces

Step 4: Set up the Canvas

Any world-space Canvas object can be manipulated in VR with a few changes. There are actually three canvases in this scene, so you’ll need to repeat this step for each of those. First, let’s find and select the JointsCanvas object under the Computer object.

4a: The first thing you’ll notice is that the Canvas component doesn’t have an Event Camera reference anymore. That’s because we deleted that camera, so now let’s add a reference to one of the cameras in the OVRCameraRig. In Unity 4.6 you can choose the LeftEyeAnchor or RightEyeAnchor camera. In 5.1+ the only choice is CenterEyeAnchor.

4b: In the Inspector, you’ll notice the canvas has a GraphicRaycaster component. This is used to detect when your mouse intersects with GUI components. Let’s remove that, and replace it with an OVRRaycaster component (in the Scripts directory), this does the same thing, but works with rays instead of mouse positions.

4c: On the new OVRRaycaster object, change the Blocking Objects drop down box selection to All. This will make sure that our gaze is blocked by objects such as the lever in the scene.

Golden_Angle.svg

 

fghjghjfhgj-40

erthethr

hgjmhjgm20

 

dhdghfhfdh36

 

gwregrgwreg5

 

lab1

ehrthtrhe21

ngdgndgfn8

 

sgnsgns7

 

yjrytryjjytjy5