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.
CARDBOARD VR: BUILDING
LOW COST VR EXPERIENCES
Mark Billinghurst
mark.billinghurst@unisa.edu.au
April 14th 2016
CHIuXiD
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
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.
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
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
VR2GO (2013)
• MxR Lab
• 3D print VR viewer for mobiles
• Open source hardware + software
• http://projects.ict.usc.edu/mxr/diy/vr2go/
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
Download and Install
• Go to unity3d.com/download
• Use Download Assistant – pick components you want
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)
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
GameObjects
• Every object in Scene is a GameObject
• GameObjects contain Components
• Eg Transform Component, Camera Component
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
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
Add More Objects
• Add several cubes
• GameObject -> 3D Object – Cube
• Move cube
• Add Rigid Body component (uncheck gravity)
Add Material
• Assets -> Create -> Material
• Click Albedo colour box in inspector
• Select colour
• Drag asset onto object to apply
Add Script
• Assets -> Create -> C# script
• Edit script using Mono
• Drag script onto Game Object
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);
}
}
#
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
Load Cardboard Main Camera
• Drag CardboardMain prefab into Hierarchy
• Assets -> Cardboard -> Prefab
• Delete CameraMain
Panorama Image Asset
• Find/create suitable panorama image
• Ideally 2K or higher resolution image
• Google “Panorama Image Cubemap”
Add Image Asset to Project
• Assets -> Import Asset
• Select desired image
• Set Texture Type to
Cubemap
• Set mapping to Latitude-
Longitude (Cylindrical)
Create Skybox Material
• Assets -> Create -> Material
• Name material
• Set Shader to Skybox -> Cubemap
• Drag texture to cubemap
One Last Thing..
• CardboardMain -> Head -> Main Camera
• Set Clear Flags to Skybox
Test It Out
• Hit play, use alt/option key + mouse to look around
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
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
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
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
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
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
Physiological Considerations
• Factors to Consider
• Head tracking
• User control of movement
• Use constant velocity
• Grounding with fixed objects
• Brightness changes
Interactive Patterns - Setup
• Setup factors to consider:
• Entering and exiting
• Headset adaptation
• Full Screen mode
• API calls
• Indicating VR apps
Interactive Patterns - Feedback
• Use audio and haptic feedback
• Reduce visual overload
• Audio alerts
• 3D spatial sound
• Phone vibrations
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
Cardboard Design Lab Application
• Use Cardboard Design Lab app to explore design ideas
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!
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/