
Augmented Reality for Developers
By :

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.
First, let's create the Earth-Moon
container:
Hierarchy
, create a new empty object under SolarSystem
, named Earth-Moon
and reset its Transfor
m
.Earth
as a child of Earth-Moon
.SolarSystem
(0
, 0.75
, 0
), Earth-Moon
(0
, 0
, 0
), and Earth
(0
, 0
, 0
).The resulting hierarchy is shown in the following screenshot:
Next, we can create a Moon
object from sphere
. We...