Presentation is loading. Please wait.

Presentation is loading. Please wait.

Cosc 5/4735 Unity and Cardboard VR. Unity3D and Cardboard Much like OpenGL, android has produced a “plugin” for unity. – You can use the asset at the.

Similar presentations


Presentation on theme: "Cosc 5/4735 Unity and Cardboard VR. Unity3D and Cardboard Much like OpenGL, android has produced a “plugin” for unity. – You can use the asset at the."— Presentation transcript:

1 Cosc 5/4735 Unity and Cardboard VR

2 Unity3D and Cardboard Much like OpenGL, android has produced a “plugin” for unity. – You can use the asset at the start or add it in to already formed project. – Download cardboard sdk for unity https://github.com/googlesamples/cardboard- unity/blob/master/CardboardSDKForUnity.unitypackag e?raw=true https://github.com/googlesamples/cardboard- unity/blob/master/CardboardSDKForUnity.unitypackag e?raw=true

3 Adding VR to unity Assets -> Import package -> Custom Package – Find the CardboardSDKForUnity.unitypackage file. – Import everything. Existing project: – Select the camera (either MainCamera or FirstPersonCharacter Camera) From menu, Component -> CardBoard->Update Steoro Cameras – You now have Cardboard ready cameras.

4 Adding VR to unity (2) For a new project – Delete the MainCamera and add the CardboardMain prefab – It has everything to control the VR mode.

5 Play mode in Unity. Mouse-based head tracking: – if you press Alt and move the mouse around, you can pan horizontally and tilt vertically around your scene as if your head is moving Cardboard around. – Use Ctrl with the mouse to simulate tilting your head from side to side. Simulating trigger pulls: – use a mouse click to simulate the action of a user using the trigger.

6 Trigger Pulls Add the following script: – public class NewBehaviourScript : MonoBehaviour { public Text textView; void Update() { if (Cardboard.SDK.Triggered) { //deal with trigger here } } } Add the script via the Add Component button – Likely to the FirstPersonCharacter.

7 A note Build & Run on unity – If you get Key error, it’s a known problem in unity3D. It’s having problems with the data connection to that phone. Works on my Moto G, fails on the Nexus 5X – Try just Build. Cmd prompt: adb install –r file.apk – -r is replace, so you can do it multiple times with the same version number.

8 References https://developers.google.com/cardboard/uni ty/ https://developers.google.com/cardboard/uni ty/

9 Q A &


Download ppt "Cosc 5/4735 Unity and Cardboard VR. Unity3D and Cardboard Much like OpenGL, android has produced a “plugin” for unity. – You can use the asset at the."

Similar presentations


Ads by Google