O'Reilly logo

Cardboard VR Projects for Android by Matt Schoen, Jonathan Linowes

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

Using a virtual screen

In virtual reality, the space you are looking into is bigger than what is on the screen at a given time. The screen is like a viewport into the virtual space. In this project, we're not calculating 3D views and clipping planes, and we're constraining the head motion to left/right yaw rotation.

You can think of the visible space as the inside surface of a cylinder, with your head at the center. As you rotate your head, a portion of the unraveled cylinder is displayed on the screen.

Using a virtual screen

The height of the virtual screen in pixels is the same as the physical device.

We need to calculate the virtual width. One way to do this, for example, ...

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