3D Game Programming

(C. Jardin) #1
Last, attach the animation to the <div> tag. Find the line that adds the render-
er.domElement (it should look like document.body.appendChild(renderer.domElement)).
Change it so that the renderer’s domElement is added to the <div> tag:

document.getElementById('ice-code-2013-06-06').appendChild(renderer.domElement);

Be sure to change the value in the getElementById() method call to whatever you
used for the id= of the <div> tag earlier.

With that, you should be able to publish your post and see your handiwork:


Be sure to share your work on the book forums: http://pragprog.com/book/csjava/3d-
game-programming-for-kids?tab=tab-forums!

21.4 What’s Next


You’re on your own now! I’ve taught you all I can, which means it’s time for
you to let your creativity loose. None of the games in this book are meant to
be finished products. Each and every game can be made better, but only if
you add code and enhance gameplay. You’ve learned a ton just by making it
to the end of the book. And now is when things get interesting—when you
find out what you can do by yourself. That’s the most exciting adventure I
can imagine for you.

Good luck! And if you need some help, don’t forget to ask in the book forums!
I look forward to hearing what you’re working on.

report erratum • discuss

What’s Next • 215


Prepared exclusively for Michael Powell

Free download pdf