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

Fine tuning the Earth

If you're a space geek, you might be thinking that there are a few things we could do to our Earth model. For one, we should add the night view texture. (Mars and the other planets don't need one because their cities shut off all their lights at night.) Also, the Earth is slightly tilted on its axis. We can fix that.

The night texture

First, let's add the night texture. To do this, let's make an Earth Java class a subclass of a Planet. Right-click on your Java solarsystem folder, select New | Java Class, and name it Earth. Then, start defining it like this:

public class Earth extends Planet { public Earth(float distance, float radius, float rotation, float orbit, int texId, int nightTexId, Transform origin) { super(distance, ...

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