<< Chapter < Page | Chapter >> Page > |
In case you are wondering where we are heading as we go down this path, I recommend that you skip ahead to the modules titled Our First 3D Game Program and A First-Person Shooter Game . Copy, compile and run the 3D game programs named GM01Test08 and Cannonball01 along with the required game-math libraries.
While the graphics and the story lines for those two game programs are rudimentary, the mathematics involved are significant. (After all, this is a course in game math and not a course in game design or high-quality graphics.)
I will present and explain a significantly updated game-math library in this module.
I will also present and explain six different sample programs that show how to use the new features in the updated library.
By studying the library and the sample programs, you will learn
I will also provide exercises for you to complete on your own at the end of the module. The exercises will concentrate on the material that you have learnedin this and previous modules.
In this section, I will present and explain a significantly updated version of the game-math library named GM01 .
In addition, I will present and explain the following programs that use the update game-mathlibrary.
A complete listing of the updated game-math library named GM01 is provided in Listing 26 near the end of the module.
A major update to add 3D capability
This is a major update to the game-math library. This version updates the earlier version named GM2D04 to a new version named simply GM01 . The primary purpose of the update was to add 3D capability for all of the 2Dfeatures provided by the previous version. Because both 2D and 3D capabilities are now included in the library, it is no longer necessary todifferentiate between the two in the name of the class. Therefore, this version is simply named GM01 .
3D to 2D projections
Adding 3D capability was tedious, but not particularly difficult in most areas of the library. However, adding 3D capability entailed majorcomplexity in one particular area: drawing the objects. It isdifficult to draw a 3D object on a 2D screen and have the drawing appear to be 3D. This requires a projection process to project each point in the 3Dobject onto the correct location on a 2D screen. There are a variety of ways to do this. This 3D library uses an approach often referred to as an oblique parallel projection . You can Google that name to learn more about the technical details of the process.
Eliminating the y-axis confusion
In addition to adding 3D capability, this version of the game library also eliminates the confusion surrounding the fact that the default direction of the positive y-axisis down the screen instead of up the screen as viewers have become accustomed to. If you funnel all of your drawing tasks through the library and don'tdraw directly on the screen, you can program under the assumption that the positive direction of the y-axis is up.
Notification Switch
Would you like to follow the 'Game 2302 - mathematical applications for game development' conversation and receive update notifications?