DIY Mobile VR with Unity 3d & Cardboard SDK

15
DIY Mobile VR with Unity & Cardboard SDK

Transcript of DIY Mobile VR with Unity 3d & Cardboard SDK

Page 1: DIY Mobile VR with Unity 3d & Cardboard SDK

DIY Mobile VR with Unity & Cardboard SDK

Page 2: DIY Mobile VR with Unity 3d & Cardboard SDK

Dr James BirtAssistant Professor of Interactive Media and Design (Games & Multimedia)• BIT (Hons), PhD (Software Engineering &

Artificial Intelligence)• 2014 Australian Office for Learning and

Teaching Citation for Outstanding Contribution to Student Learning

• 15+ years industry & academic experience• https://bond.edu.au/profile/dr-james-birt

Page 3: DIY Mobile VR with Unity 3d & Cardboard SDK

Setup - What do you need?

Unity 5 - https://unity3d.com/ Google Cardboard SDK for Unity - https://developers.google.com/cardboard/unity/download

Hardware:- Android Phone – E.g. Samsung S6 - Head Mounted Cardboard – E.g.

ColorCross - Bluetooth Controller – E.g. PlayStation 4

First Person Character Controller - https://dl.dropboxusercontent.com/u/9011716/Character%20Controllers.zip

Page 4: DIY Mobile VR with Unity 3d & Cardboard SDK

Create New Project

Create the project in your own folder location

1

2

Page 5: DIY Mobile VR with Unity 3d & Cardboard SDK

• Download First Person Character Controller from - https://dl.dropboxusercontent.com/u/9011716/Character%20Controllers.zip

• Unzip the controller into your Assets Folder as shown

Add Character Controller

Page 6: DIY Mobile VR with Unity 3d & Cardboard SDK

Add Cardboard SDK1

2

https://developers.google.com/cardboard/unity/download

Page 7: DIY Mobile VR with Unity 3d & Cardboard SDK

Create a Test Scene

Be mindful of your Frame Rates try to reduce your lighting overheads

Page 8: DIY Mobile VR with Unity 3d & Cardboard SDK

Build Cardboard Controller (Part1)

1. Add FPSController Prefab to your Hierarchy

2. Set the FPSController object Transform to align with your scene

Page 9: DIY Mobile VR with Unity 3d & Cardboard SDK

Build Cardboard Controller (Part2)

1. Add CardboardMain Prefab to you Hierarchy and child to your FPSController

2. Set the CardboardMain object Transform to the same values as the FPSController Camera

3. Remove the Main Camera from the FPSController & Hierarchy

Page 10: DIY Mobile VR with Unity 3d & Cardboard SDK

Build Cardboard Controller (Part3)

1. Move the Cardboard Head (Script) From Head to First Person Controller

2. Turn off Track Position

3. Set Update Early

These steps will allow you to move in the direction your character controller is facing

Page 11: DIY Mobile VR with Unity 3d & Cardboard SDK

Connect Your PS4 Controller1. On controller hold down Share & PS buttons until light bar flashes

white

2. On Android device, enable Bluetooth, then select the “Wireless Controller” option listed. Once connected you will notice you can use the controller to navigate your device

Page 12: DIY Mobile VR with Unity 3d & Cardboard SDK

Set Build Settings for Android

1

2

3 4

5

Add your app details settings I have left as

default

Page 13: DIY Mobile VR with Unity 3d & Cardboard SDK

Remap Controller Buttons

• Please note: Different android devices will map the PlayStation buttons differently

• You will need to experiment with the button controls and actions

• This list is for PC only

Page 14: DIY Mobile VR with Unity 3d & Cardboard SDK

Build to Your Android Device

1

For details on how to setup your Android phone:http://www.slideshare.net/jamesbirt35/visualisation-interactive-prototyping-with-unity3d

2

Page 15: DIY Mobile VR with Unity 3d & Cardboard SDK

Demo Scene

To make your lighting dynamic try adding the following JavaScript code to your directional light & set your speed variable e.g. 5