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, ...

Get Cardboard VR Projects for Android now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.