Challenge: Create an Earth Orbit Frame of Reference

You can do this. Just follow the steps that we took for the moon:

  • Create a 3D object to hold Earth, and add it to the sun.

  • Add Earth to the new orbit frame of reference instead of the scene.

  • Delete the animate code that sets Earth’s position.

  • Rotate Earth’s orbit.

Once you do that, you have a very complex astronomical simulation that is built using nothing but simple frame of reference—no complicated sines or cosines anywhere!

Get 3D Game Programming for Kids 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.