Chapter 14Project: Phases of the Moon

When you’re done with this chapter, you will

  • Know the most important trick in a 3D programmer’s virtual toolbox

  • Know strategies to make big changes to existing code

  • Understand moon phases better than most people (but not the Toy Story animators)

The retrograde-motion chapter was pretty amazing, but in this chapter we’ll cover something every 3D programmer must learn at some point: how to visualize the moon and its phases. It’ll end up looking like this:

images/moon_phases/when_you_are_done.png

Why is it important to simulate the moon’s phases? First, it’s a simple enough problem—the sun shines on the moon, which revolves around Earth—that lets ...

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.