HTML and CSS Reference
In-Depth Information
Figure 9.7. Your code should output the displayed error of “run.js is missing” or no errors at all when running
index.html. If you have trouble with the engine files as you proceed, just replace them with the source files from
Manning's website. It's a nightmare to debug WebGL because of browsers not having easily accessible graphic
monitoring tools.
With the last of the utility helpers in place, you should now feel somewhat comfortable
with graphics card communication, comfortable enough to write basic 3D output for a We-
bGL application at least. Next, we'll take the foundation you created and use it to build
your interactive 3D game: Geometry Destroyer.
9.3. Putting it all together: creating Geometry Destroyer
Creating 3D shapes is tough, but you just created (or read through as we created) a 3D en-
gine that will significantly simplify the process. You can create new entities and attach 3D
data via matrices; the engine will take care of outputting all the data for you. The engine
will also take care of cleaning data out of memory whenever you need to.
In this section, you'll build a cool game as you learn to
• Write a simple matrix to output shape and color in 3D space
• Create 3D rotation data and use it with a controller to indicate direction in 2D
• Create and control entity generations for enemies and particles
• Use indices to turn triangles into squares for easy matrix creation
• Draw simple 2D shapes in 3D, plus unique polygons and cubes
Search WWH ::

Custom Search