Building an earth-moon system

Let's add the moon and animate it to orbit the earth. We will organize this in the hierarchy under a new container object that we'll call Earth-Moon. This way, we can keep the earth and the moon together so later we can move them as a unit (a celestial pair) when they orbit around the sun.

You may wonder why not just make the moon a child object of the earth so they'll move together around the sun? Well, the earth also spins its day-night cycle, and we don't want the moon to inherit that angular rotation, so its orbit is separate.

Get Augmented Reality for Developers 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.