Virtual reality is a medium with tremendous potential. The ability to be transported to other places,
to be fully immersed in experiences, and to feel like you’re really there—present—opens up
previously unimagined ways to interact and communicate. Until recently, virtual reality was out
of reach for the average consumer due to cost and other factors. However, advances in the
technology over the last few years have set the stage for a mass-market revolution that could be as
influential as the introduction of television, the Internet, or the smartphone.
Virtual reality—VR for short—comprises a collection of technologies: 3D displays, motion
tracking hardware, input devices, software frameworks, and development tools. While
consumer-grade VR hardware is young and evolving, a handful of platforms have emerged as go-
to choices, including the Oculus Rift, Samsung Gear VR, and Google Cardboard. Each delivers a
different level of VR experience, at a different price point, with varying degrees of in-your-hands
portability.
Software to create and display consumer virtual reality is also coming together rapidly. The
Unity3D and Unreal game engines, popular for making desktop and mobile games, have become
tools of choice for native VR development. And the Web is not far behind: WebGL and 3D
JavaScript frameworks like Three.js and Babylon.js are providing a path for creating open source,
browser-based virtual reality experiences for desktop and mobile operating systems.
It’s an exciting time! With so much energy going into development, and so much consumer interest,
VR just might be the next big wave of computer technology. In this book, we explore the hardware,
software, application techniques, and interface design challenges encountered by today’s virtual
reality creator. Virtual reality is still in its early stages. It’s a lot like the Wild West, and you are a
pioneer. The landscape may be fraught with unknowns, even dangers—but we push on, driven by
the promise of a better life. Let’s take a peek at this new frontier.
Figure 1-1 shows a screenshot of the now-famous Tuscany VR demo, created by the team at
Oculus VR to show off their hardware. Put on the Oculus Rift and launch the demo. You are on
the grounds of a Tuscan estate, looking at a beautiful villa. Clouds drift lazily across the sky. You
hear birds chirping, and the sound of waves lapping gently against a shore.
You move through the scene, video game–style, using the W, A, S, and D keys on your keyboard
(known to gamers as the “WASD keys”). If you play a lot of PC games, this is nothing new. But
now, turn your head: looking up, down, and behind, you can see the entire estate. You are there,
immersed in a virtual world that completely surrounds you. Walk forward, into the villa, and take
a look around. Walk out, up to the edge of the property, and see the lake below. For a few moments
at least, you forget that you are not actually in this other place. You’re present.
This feeling of total immersion—of being somewhere else, experiencing something else entirely—
is what we are striving for with virtual reality. And this is where our journey begins.
,Figure 1-1. Tuscany VR demo by the Oculus VR team
What Is Virtual Reality?
Reality is merely an illusion, albeit a very persistent one.
Albert Einstein
Virtual reality has one goal: to convince you that you are somewhere else. It does this by tricking
the human brain—in particular, the visual cortex and parts of the brain that perceive motion. A
variety of technologies conspire to create this illusion, including:
Stereoscopic displays
Also known as 3D displays or head-mounted displays (HMDs), these displays use a
combination of multiple images, realistic optical distortion, and special lenses to produce
a stereo image that our eyes interpret as having three-dimensional depth.
Motion tracking hardware
Gyroscopes, accelerometers, and other low-cost components are used in virtual reality
hardware to sense when our bodies move and our heads turn, so that the application can
update our view into the 3D scene.
Input devices
, Virtual reality is creating the need for new types of input devices beyond the keyboard and
mouse, including game controllers and hand- and body-tracking sensors that can recognize
motion and gestures.
Desktop and mobile platforms
This includes the computer hardware, operating systems, software to interface to the
devices, frameworks and engines that run applications, and software tools for building
them.
Without all four of these components, it is hard to achieve a fully immersive virtual reality
experience. We will dive further into the details throughout the book; for now, let’s take a quick
look at each.
Stereoscopic Displays
The main ingredient in virtual reality is a persistent 3D visual representation of the experience that
conveys a sense of depth. To create this depth, virtual reality hardware systems employ a 3D
display, also known as a stereoscopic display or head-mounted display.
For years, one of the biggest impediments to consumer-grade virtual reality was an affordable
stereoscopic display that is light and comfortable enough to be worn for an extended period. This
situation changed dramatically when the team from Oculus VR created the Oculus Rift. First
introduced in 2012, the Rift was a breakthrough in VR hardware, featuring a stereoscopic display
and a head-tracking sensor built into a lightweight headset that could be purchased as a
development kit for a few hundred dollars. While the original development kit, known as the DK1,
was fairly low-resolution, it was enough to get the entire industry excited and unleash a storm of
VR development. Newer Rift development kit versions, such as the DK2 depicted in Figure 1-2,
feature higher display resolution, position as well as orientation tracking, and better performance.