O'Reilly logo

Learning Virtual Reality by Tony Parisi

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

Chapter 3. Going Native: Developing for Oculus Rift on the Desktop

The next several chapters cover the essentials of virtual reality development. We’ll start by creating a native application for desktop computers using the Oculus Rift. While the information in this chapter is specific to the Rift and the Oculus SDK, the same techniques will apply when developing for the HTC Vive and other headsets.

In programming our first VR application, we will explore these core concepts:

Constructing a 3D scene

We’ll see how to create the visual, interactive, and scripted elements that represent the virtual reality environment.

Rendering the 3D scene in stereo

We’ll look at how to render the scene from each of two cameras representing the user’s eyes. Via the lenses in the Oculus Rift headset, the two rendered images are combined into a single, coherent visual field to create a stereoscopic view of the environment.

Head tracking to provide presence

We’ll see how to use the position and orientation of the Oculus Rift headset to change the virtual camera’s position and orientation within the environment.

To illustrate these ideas, we need to write 3D code. Programming to a 3D rendering API like OpenGL or DirectX is a lot of work, and is beyond the scope of this book. Instead, we are going to use the popular Unity3D game engine. Unity provides enough power to build games and VR quickly without too steep of a learning curve.

But before we delve into Unity, let’s make sure we understand ...

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

Start Free Trial

No credit card required