Short tutorial given by Mark Billinghurst on April 14th 2016 on how to build low cost VR experiences using the Google Cardboard VR viewer. The slides show how to use Unity and the Cardboard SDK to build VR applications.
Mark BillinghurstDirector at HIT Lab NZ um University of South Australia
1. CARDBOARD VR: BUILDING
LOW COST VR EXPERIENCES
Mark Billinghurst
mark.billinghurst@unisa.edu.au
April 14th 2016
CHIuXiD
2. What You Will Learn
• Virtual Reality Fundamentals + History
• How to Build Cardboard VR Viewer
• Example Cardboard VR Applications
• Basics of Unity Programming
• How to Make Panorama VR Applications
• How to Create VR Scenes
• How to Add Interactivity to VR Applications
• Cardboard Design guidelines
6. David Zeltzer’s AIP Cube
! Autonomy – User can to
react to events and stimuli.
! Interaction – User can
interact with objects and
environment.
! Presence – User feels
immersed through sensory
input and output channels
Interaction
Autonomy
Presence
VR
Zeltzer, D. (1992). Autonomy, interaction, and presence. Presence: Teleoperators
& Virtual Environments, 1(1), 127-132.
7. Key Technologies
• Autonomy
• Head tracking, body input
• Intelligent systems
• Interaction
• User input devices, HCI
• Presence
• Graphics/audio/multisensory output
• Multisensory displays
• Visual, audio, haptic, olfactory, etc
20. Mobile Phone AR & VR
• Mobile Phone AR
• Mobile phone
• Live camera view
• Senor input (GPS, compass)
• Mobile Phone VR
• Mobile phone
• Senor input (compass)
• Additional VR viewer
21. VR2GO (2013)
• MxR Lab
• 3D print VR viewer for mobiles
• Open source hardware + software
• http://projects.ict.usc.edu/mxr/diy/vr2go/
29. Version 1.0 vs Version 2.0
• Version 1.0 – Android focused, magnetic switch, small phone
• Version 2.0 – Touch input, iOS/Android, fits many phones
32. Cardboard App
• 7 default experiences
• Earth: Fly on Google Earth
• Tour Guide: Visit sites with guides
• YouTube: Watch popular videos
• Exhibit: Examine cultural artifacts
• Photo Sphere: Immersive photos
• Street View: Drive along a street
• Windy Day: Interactive short story
43. Download and Install
• Go to unity3d.com/download
• Use Download Assistant – pick components you want
44. Getting Started
• First time running Unity you’ll be asked to create a project
• Specify project name and location
• Can pick asset packages (pre-made content)
47. Building Scenes
• Use GameObjects:
• Containers that hold different components
• Eg 3D model, texture, animation
• Use Inspector
• View and edit object properties and other settings
• Use Scene View
• Position objects, camera, lights, other GameObjects etc
• Scripting
• Adding interaction, user input, events, etc
48. GameObjects
• Every object in Scene is a GameObject
• GameObjects contain Components
• Eg Transform Component, Camera Component
49. Adding 3D Content
• Create 3D asset using modeling package, or download
• Fbx, Obj file format for 3D models
• Add file to Assets folder in Project
• When project opened 3D model added to Project View
• Drag mesh from Project View into Hierarchy or Scene View
• Creates a game object
53. Making a Simple Scene
1. Create New Project
2. Create Game Object
3. Moving main camera position
4. Adding lights
5. Adding more objects
6. Adding physics
7. Changing object materials
8. Adding script behaviour
63. Example C# Script
GameObject Rotation
using UnityEngine;
using System.Collections;
public class spin : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
this.gameObject.transform.Rotate(Vector3.up*10);
}
}
#
64. Scripting C# Unity 3D
• void Awake():
• Is called when the first scene is loaded and the game object is active
• void Start():
• Called on first frame update
• void FixedUpdate():
• Called before physics calculations are made
• void Update():
• Called every frame before rendering
• void LateUpdate():
• Once per frame after update finished
68. Steps
1. Create a new project
2. Load the Cardboard SDK
3. Load a panorama image asset
4. Create a Skymap
5. Add to VR scene
6. Deploy to mobile phone
73. Add Image Asset to Project
• Assets -> Import Asset
• Select desired image
• Set Texture Type to
Cubemap
• Set mapping to Latitude-
Longitude (Cylindrical)
74. Create Skybox Material
• Assets -> Create -> Material
• Name material
• Set Shader to Skybox -> Cubemap
• Drag texture to cubemap
77. One Last Thing..
• CardboardMain -> Head -> Main Camera
• Set Clear Flags to Skybox
78. Test It Out
• Hit play, use alt/option key + mouse to look around
79. Deploy to Mobile (Android)
1. Plug phone into USB
• make sure device in debug mode
2. Set correct build settings
3. Player settings
• Other settings
• Set Bundle Idenitfier -> com.Company.ProductName
• Resolution and Presentation
• Default Orientation -> Landscape Left
4. Build and run
80. Deploying to Phone
1. Plug phone into USB
2. Open Build Settings
3. Change Target platform to Android
4. Resolution and Presentation
• Default Orientation -> Landscape Left
5. Under Player Settings
• Edit Bundle Identifier – eg com.UniSA.cubeTest
• Minimum API level
6. Build and Run
• Select .apk file name
83. Key Steps
1. Creating a new project
2. Load Cardboard SDK
3. Replace camera with CardboardMain
4. Loading in 3D asset packages
5. Loading a SkyDome
6. Adding a plane floor
86. Load Asset + Add to Scene
• Assets -> Import Package -> Custom Package
• Look for MagicLamp.unitypackage (If not installed already)
• Drag MagicLamp_LOD0 to Hierarchy
• Position and rotate
93. Adding Movement
Goal: Move in direction user looking when
Cardboard Button pressed.
• Key Steps
1. Start with static screen
2. Create movement script
3. Add movement script to Camera head
4. Deploy to mobile
100. Google Design Guidelines
• Google’s Guidelines for good VR experiences:
• Physiological Considerations
• Interactive Patterns
• Setup
• Controls
• Feedback
• Display Reticle
• From http://www.google.com/design/spec-vr/designing-
for-google-cardboard/a-new-dimension.html
101. Physiological Considerations
• Factors to Consider
• Head tracking
• User control of movement
• Use constant velocity
• Grounding with fixed objects
• Brightness changes
102. Interactive Patterns - Setup
• Setup factors to consider:
• Entering and exiting
• Headset adaptation
• Full Screen mode
• API calls
• Indicating VR apps
104. Interactive Patterns - Feedback
• Use audio and haptic feedback
• Reduce visual overload
• Audio alerts
• 3D spatial sound
• Phone vibrations
105. Interactive Patterns - Display Reticle
• Easier for users to target objects with a display reticle
• Can display reticle only when near target object
• Highlight objects (e.g. with light source) that user can target
106. Cardboard Design Lab Application
• Use Cardboard Design Lab app to explore design ideas
109. Conclusion
• Virtual Reality industry starting to boom again
• Google Cardboard provides a great entry for VR
• Consumer hardware
• Cheap/free viewer
• Industry standard game engine
• High quality content
• Many tutorials/learning resources
• The time to get started is now!
111. Useful Resources
• Google Cardboard main page
• https://www.google.com/get/cardboard/
• Developer Website
• https://www.google.com/get/cardboard/developers/
• Building a VR app for Cardboard
• http://www.sitepoint.com/building-a-google-cardboard-vr-app-in-unity/
• Creating VR game for Cardboard
• http://danielborowski.com/posts/create-a-virtual-reality-game-for-
google-cardboard/
• Moving in VR space
• http://www.instructables.com/id/Prototyping-Interactive-Environments-
in-Virtual-Re/