HTML and CSS Reference
In-Depth Information
As you can see, there are only minor changes to the main document, because most of the work happens
in Triangle class. However, all the triangles are now the same color, which shows off the lighting effect
much better (see Figure 17-6).
Figure 17-6. 3D solid with backface culling, depth sorting, and 3D lighting
Summary
That was a lot to cover in just a few pages! But the results are incredible and you now have the tools to
make some stunning 3D animations. There are a lot of variations you can throw in here; for instance, in the
last example, the light is stationary and the object moves. Try moving the light around instead. (It's just a
matter of altering its x, y, and/or z positions.)
That about wraps up our main discussion of 3D. In the next chapter, you look at matrix math, which is
often used as an alternative to some of the scaling and rotation methods you used so far, and thus is
something you often see in 3D programming.
 
Search WWH ::




Custom Search