Solar System
Pro
Three.js
Simulation
A 3D solar system built with Three.js. Planets orbit a star and moons orbit planets -- and nothing in the code ever computes a moon's position, because each body is a child of the one it orbits and inherits its motion for free. Focus any body, speed time up or slow it down, toggle the lights, and switch every planet between three material types to see exactly what lighting contributes.
Controls
Mouse: Drag to orbit the camera, scroll to zoom. Buttons cycle which body the camera follows, change the speed of time, and toggle the orbit rings. Toggle the ambient and point lights, or switch material type, to see how each affects the scene.
This game is built in Lesson 9.3. View the curriculum