Code: Phases of the Moon
This is the final version of the moon-phases code from Chapter 13, âProject: Phases of the Moonâ:
â | <body></body> |
â | <script src=â"/three.js"â></script> |
â | <script src=â"/controls/FlyControls.js"â></script> |
â | <script> |
â | â// The "scene" is where stuff in our game will happen:â |
â | âvarâ scene = ânewâ THREE.Scene(); |
â | âvarâ flat = {flatShading: âtrueâ}; |
â | âvarâ light = ânewâ THREE.AmbientLight(â'white'â, 0.1); |
â | scene.add(light); |
â | |
â | â// The "camera" is what sees the stuff:â |
â | âvarâ aspectRatio = window.innerWidth / window.innerHeight; |
â | âvarâ w = window.innerWidth / 2; |
â | âvarâ h = window.innerHeight / 2; |
â | âvarâ camera ... |
Get 3D Game Programming for Kids, 2nd Edition 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.