O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Virtual Reality Blueprints

Book Description

Join the virtual reality revolution by creating immersive 3D games and applications with Cardboard VR, Gear VR, OculusVR, and HTC Vive

About This Book

  • Develop robust, immersive VR experiences that are easy on the eye.
  • Code 3D games and applications using Unity 3D game engine.
  • Learn the basic principles of virtual reality applications

Who This Book Is For

If you are a game developer and a VR enthusiast now looking to get stuck into the VR app development process by creating VR apps for different platforms, then this is the book for you. Familiarity with the Unity game engine and the C# language is key to getting the most from this book.

What You Will Learn

  • Use Unity assets to create object simulation.
  • Implement simple touch controls in your application.
  • Apply artificial intelligence to achieve player and character interaction.
  • Add scripts for movement, tracking, grasping, and spawning.
  • Create animated walkthroughs, use 360-degree media, and build engaging VR experiences.
  • Deploy your games on multiple VR platforms.

In Detail

Are you new to virtual reality? Do you want to create exciting interactive VR applications? There's no need to be daunted by the thought of creating interactive VR applications, it's much easier than you think with this hands-on, project-based guide that will take you through VR development essentials for desktop and mobile-based games and applications. Explore the three top platforms—Cardboard VR, Gear VR, and OculusVR —to design immersive experiences from scratch.

You'll start by understanding the science-fiction roots of virtual reality and then build your first VR experience using Cardboard VR. You'll then delve into user interactions in virtual space for the Google Cardboard then move on to creating a virtual gallery with Gear VR. Then you will learn all about virtual movements, state machines, and spawning while you shoot zombies in the Oculus Rift headset. Next, you'll construct a Carnival Midway, complete with two common games to entertain players.

Along the way, you will explore the best practices for VR development, review game design tips, discuss methods for combating motion sickness and identify alternate uses for VR applications

Style and approach

A project-based guide with every project built across chapters.

Downloading the example code for this book You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

Table of Contents

  1. Title Page
  2. Copyright and Credits
    1. Virtual Reality Blueprints
  3. Packt Upsell
    1. Why subscribe?
    2. PacktPub.com
  4. Foreword
  5. Contributors
    1. About the authors
    2. About the reviewer
    3. Packt is searching for authors like you
  6. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
      1. Download the example code files
      2. Download the color images
      3. Conventions used
    4. Get in touch
      1. Reviews
  7. The Past, Present, and Future of VR
    1. The history of virtual reality
    2. Through the looking glass
    3. Making a static image dance
    4. The bigger the better – panoramic paintings
    5. Stereoscopic viewers
    6. Why stop at just sight and sound? – Smell o' Vision and Sensorama
    7. Link Trainers and Apollo
    8. Interactivity and True HMDs
      1. 1960 – TelesphereMask
      2. 1961 – Headsight
      3. 1968 – Teleyeglasses
      4. 1965 – The Ultimate Display
      5. 1968 – Sword of Damocles
      6. 1968 – The mother of all demos
      7. 1969 – Virtual Cockpit/Helmet Mounted Sight
      8. 1969 – Artificial Reality
      9. 1995 – CAVE
      10. 1987 – Virtual reality and VPL
      11. 1989 – Nintendo Powerglove
    9. 1990s – VR Explosion
      1. 1991 – Virtuality Dactyl Nightmare
      2. 1993 – SEGA VR glasses
      3. 1995 – VRML – Virtual reality Markup Language
      4. 1995 – Nintendo Virtual Boy
      5. 1995 – Hasbro Toaster
      6. 2013 – Oculus Rift
      7. 2014 – Google Cardboard
      8. 2015 – Samsung Gear VR
      9. 2018 – Magic Leap
    10. Summary
  8. Building a Solar System for Google Cardboard
    1. Platform setup
    2. Google Cardboard setup
    3. Setting up the Unity environment
    4. Building the TRAPPIST-1 System
    5. Building the application
      1. Android Instructions
        1. Building an Android application
        2. Invalid command Android error
      2. iOS Instructions
        1. Preparing your Unity project for iOS
        2. Building an iOS application
    6. Summary
  9. Building an Image Gallery System for the Gear VR
    1. A virtual image gallery
      1. The Samsung Gear VR platform
      2. Process overview – Part 1
    2. Getting started in VR
    3. Prepping for VR
    4. Acquiring the Oculus SDK package
    5. Constructing a panoramic skybox
    6. Creating the Gallery prefab
      1. Optional custom fonts
    7. Building the galleries
      1. Creating the image display element (FullImage)
      2. Creating a controller and a scene controller script
      3. Creating a gallery prefab
    8. Summary
  10. Adding User Interactions to the Virtual Gallery Project
    1. Facilitating user interaction
      1. Raycasters
      2. StandaloneInput module
      3. Image selector
        1. Setting touch control
        2. Creating feedback for the user
      4. Scene controller
      5. Image collection
      6. Adding imagery
      7. Use a highlight material as feedback
      8. Assigning values
    2. Finalizing user interaction
    3. Using Event Triggers for user feedback
    4. Building the application
      1. Creating an osig file
      2. Preparing your Android device
      3. Building an Android application
    5. Summary
  11. Fighting Zombies on the Oculus Rift
    1. Playing with zombies
    2. The Oculus Rift platform
    3. Process overview – Part 1
    4. Setting up the Unity environment
    5. Creating the Player GameObject
      1. Graphic Raycaster
      2. Adding a 3D camera
    6. Building the game environment
      1. Constructing gameplay boundaries
      2. Setting the mood
      3. Creating spawn points
    7. Optimizing the experience for VR
      1. Frame rate is key to performance
      2. Reducing excessive scene geometry
        1. Removing unnecessary objects
        2. Using planes
        3. Occlusion culling
      3. Lightmapping
    8. Creating the zombie prefab
      1. Animating the zombie assets
      2. Adding transitions
    9. Summary
  12. Scripting Zombies for the Oculus Rift
    1. Scripting the zombies
      1. Summoning zombies
        1. ZombieSpawner script
      2. Controlling the zombie prefab
        1. ZombieController script
      3. Fighting back
        1. PlayerController script
          1. Update function
          2. Shoot function
          3. OnDrawGizmos function
          4. Testing the PlayerController
          5. Targeting reticle cursor
    2. Setting the mood
    3. Building an executable
    4. Summary
    5. Expanding the experience
  13. Carnival Midway Games — Part 1
    1. Recreating carnival games
    2. Preproduction
    3. Special production note
    4. Requirements
    5. Process overview – Part 1
      1. Preparing Unity for VR development on the Rift
      2. Loading the OVRP
      3. Setting up the project
      4. Creating the player avatar
      5. Designing the play area
      6. Building the game environment
        1. Building the game booth
        2. Adding 3D text
        3. Creating the booth prefab
        4. Planning the midway activities
        5. Adding clutter to the scene
      7. Combating VR sickness
        1. Eliminating non-forward motion
        2. Consider adding UI overlays
        3. Reducing acceleration
        4. Reducing yaw
        5. Reducing vection
        6. Using appropriate motions
      8. Implementing movement
        1. A gaze-based teleportation system
        2. Mapping touch controller buttons
        3. Deactivating stick movement  [Optional] 
    6. Making objects grabbable
    7. Summary
  14. Carnival Midway Games — Part 2
    1. Backing up the project
      1. Local backup
      2. Unity Collaborate
      3. Software version control services
    2. Midway booth games
      1. Wacky Mole props
        1. The GameTable
        2. The mole
        3. The Score Board
        4. Crispy UI Text
        5. The mallet
      2. Animating the mole
      3. Building an animation state machine
      4. Scripting the mole asset
      5. Scripting the mole game controller
      6. Finishing the Wacky Mole game
      7. Milk Bottle Toss props
        1. Game props
        2. Scripting the Milk Bottle Toss game
    3. Building the application
    4. Expanding the game
    5. Summary
  15. VR Hardware Roundup
    1. VR hardware roundup
      1. Google Cardboard
      2. Google Daydream
      3. Gear VR
      4. Oculus Rift
      5. Vive
      6. Sony PSVR
      7. HoloLens
    2. Headset costs
  16. VR Terms and Definitions
    1. VR terms and definitions
    2. Primer of best practices
      1. Input
      2. Movement
      3. User interface and experience design
      4. Motion sickness
      5. Motion sickness prevention, there is no cure
  17. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think