HTML and CSS Reference
loaded with great techniques to help you work with libraries, create cross-browser solu-
tions, and maintain your code.
To create 3D shape objects, you also need to send the graphics card some packaged matrix
ling such information. You could write a matrix processing library for your engine from
scratch, but it's quite a lot of work. Instead, you'll use sylvester.js to process everything.
Get the latest version of the script from http://sylvester.jcoglan.com/ , unzip it, and include
the sylvester.js file in your assets folder.
The last asset you need is webgl_util.js, which contains lots of prewritten code to help with
generating a perspective, processing matrixes, and more. We wish we could credit the au-
thor of this great script, but as Mozilla says, “Nobody seems entirely clear on where it came
from.” Grab the file at http://mng.bz/P7Vi and place it in assets.
Wait—didn't you say “custom rolled engine”?
Earlier we said that our WebGL tutorial centers on a built-from-scratch engine, which may
lead you to ask, “Why are you making me use assets that aren't from scratch?” Truth is,
we don't have time to custom roll everything; it would take at least 100 more pages to ex-
plain a complete engine step by step, so we thought that adding a few scripts to simplify
everything was a good idea. We hope you agree!
9.1.2. Tools to create, alter, and delete objects
With your assets in place, let's get to work on the engine.