The Zen of Direc3d Game Programming

by
Edition: CD
Format: Paperback
Pub. Date: 2002-06-01
Publisher(s): Cengage Learning Ptr
List Price: $64.19

Rent Book

Select for Price
There was a problem. Please try again later.

New Book

We're Sorry
Sold Out

Used Book

We're Sorry
Sold Out

eBook

We're Sorry
Not Available

How Marketplace Works:

  • This item is offered by an independent seller and not shipped from our warehouse
  • Item details like edition and cover design may differ from our description; see seller's comments before ordering.
  • Sellers much confirm and ship within two business days; otherwise, the order will be cancelled and refunded.
  • Marketplace purchases cannot be returned to eCampus.com. Contact the seller directly for inquiries; if no response within two days, contact customer service.
  • Additional shipping costs apply to Marketplace purchases. Review shipping costs at checkout.

Summary

Whether you're a professional programmer looking to get up to speed on DirectXr 8.0 or a hobbyist new to game programming, this book will be your ultimate guide to programming amazing 3D computer graphics with Microsoftr Direct3Dr 8.0! It provides a solid introduction to interactive entertainment engineering, Windowsr programming, and advanced graphical techniques. Inside you'll find deep coverage of 2D graphics, including using double buffering, page flipping, programming a bitmap font engine, and creating a Quake-style programmable console. Read on to learn sophisticated 3D graphics programming techniques such as bilinear filtering, texturing, materials, lights, and how to develop an object-orientated frame based object hierarchy in order to simulate amazingly realistic animation effects. Begin your journey into the world of Direct3D - and great games - here, now!

Table of Contents

Introduction xxvii
Part 1 Learning The Ropes 1(48)
Introduction to Direct3D and DirectX
3(20)
What Exactly Is DirectX?
5(7)
In the Beginning
9(1)
And Then There Was DirectX
10(2)
How Does Direct3D Fit In?
12(9)
Immediate Mode vs. Retained Mode
13(1)
Why Bother with 2D?
14(1)
COM with Me
15(5)
COM in Action
20(1)
Accessing COM with C
20(1)
Conclusion
21(2)
90 Percent Preparation, 10 Percent Initialization
23(14)
Installing the DirectX SDK
24(1)
Setting Up Visual Studio to Use DirectX
25(3)
Creating a New Project
28(3)
Adding a File to Your Project
30(1)
Setting Up Your Project to Use DirectX
31(1)
Compiling and Executing
32(1)
Some Rules to Live By
33(2)
Adding a Little Structure to Your Life
33(1)
Did You Back Up?
34(1)
Care to Comment?
35(1)
Conclusion
35(2)
The Structure of a Direct3D Application
37(12)
The Game Loop
38(6)
Initialization
40(1)
Check Game Status
40(1)
Interface with Windows
40(1)
Acquire User Input
41(1)
Update Character Positions
41(1)
Game Logic
41(1)
Render Graphics
42(1)
Playing Sound FX
42(1)
Synchronization
43(1)
Shutdown
43(1)
Real-Life Games
44(3)
Conclusion
47(2)
Part Two: Windows Programming 49(164)
Did Not Have a Relationship with MS Windows
51(16)
The Importance of Windows
53(1)
Nice Programs Share Their Toys
54(3)
Hungarian Notation
57(4)
Variables
59(2)
Events: A New Style of Programming
61(1)
Don't Shoot the Messenger
62(3)
Conclusion
65(2)
Goodbye World
67(14)
Your First Windows Program
68(2)
The New Include Files
70(1)
The New Entry Point
71(3)
The Message Box[] Function
74(3)
The Return Value
77(1)
The Results
78(1)
Conclusion
79(2)
Selling Your Soul
81(38)
100 Lines of Code
82(1)
Relax---It's Only Nine Function Calls
83(1)
A Walk through WinMain[]
84(10)
Your Variables: A Handle, a Message, and a Touch of Class
85(9)
Registering the Window Class
94(1)
Creating the Windows
94(6)
Displaying the Window
100(1)
The Message Loop
101(3)
GetMessage[]
102(1)
TranslateMessage[]
103(1)
DispatchMessage[]
104(1)
The Return Value Returns!
104(1)
A Stroll through WndProc[]
105(3)
The Switch
108(7)
WM_Create
109(1)
WM_Paint
109(1)
WM_Destroy
110(1)
Letting Windows Take Care of It
111(4)
Turning an Application into a Game
115(3)
Conclusion
118(1)
Getting Jiggy with Windows
119(94)
The Device Context
120(5)
Obtaining the Device Context
121(1)
The Color of Light
122(2)
Windows Coordinates
124(1)
Code Blue! Calling Dr. da Vinci
125(11)
Points
126(2)
Lines
128(2)
Rectangles
130(1)
Ellipses and Circles
131(1)
Text
132(4)
Oh, That Is So Picasso!
136(14)
Pens
136(7)
Brushes
143(7)
Getting Advanced with the Device Context
150(6)
Bitmaps
156(10)
Advanced Bitmaps
166(2)
What's on the Menu?
168(7)
A Natural at Resources
169(2)
A Menu Fit for a King
171(2)
Gluing the Menu to the Window
173(2)
Handling Keyboard Input: Windows Way
175(6)
Don't Get Asynchronous on Me
178(3)
The Mice Are Coming!
181(5)
Don't Sync Out on Me, Man
184(2)
Asynchronous Graphics
186(1)
Synchronization
186(1)
Advanced Rendering Using Raster Operations
187(2)
Zong!
189(23)
Initialization
210(1)
Zong's Game Loop
210(1)
Shutdown
211(1)
Some Meandering Thoughts on Zong
211(1)
Conclusion
212(1)
Part Three 2D Directx Graphics 213(200)
How Many Lines of Code?
215(90)
Microsoft And The Infinite Wisdom
216(2)
Pixels and Resolution: Give Me the Pitch
218(9)
The 2D Rendering Process
219(5)
A Bit about Display Modes
224(1)
Palettes
225(2)
Error Handling
227(2)
Getting Your Hands Dirty
229(25)
The Direct3D Include Files
230(1)
Getting Ready to Rock---Initializing Direct3D
230(2)
Setting Up the Surfaces
232(6)
Back to Setting Up
238(4)
Creating the Device
242(5)
Shutting Down DirectX
247(7)
Moving to Full Screen
254(5)
Rendering with Direct3D
259(8)
Getting in the Back Door
260(7)
Drawing
267(17)
Plotting Pixels
267(2)
Drawing Rectangles
269(3)
Bitmaps: The Direct3D Way
272(4)
Copying Surfaces to the Back Buffer
276(8)
Using the GDI with Direct3D Surface
284(16)
Creating a Direct3D-Compatible Device Context
285(2)
Deleting the Compatible DC from Memory
287(1)
Copying a DC to a Direct3D Surface
288(12)
Device Validation
300(4)
Conclusion
304(1)
Putting Direct3D to Work
305(66)
Color-Keyed Surface Copying
306(6)
Keeping Track of Time
312(10)
Timing Back in the Old Days
313(1)
Windows Timing
313(2)
64-Bit High Precision Timers
315(3)
Using Precision Timing to Control Execution Speed
318(2)
Tracking the Frame Rate
320(2)
Developing a 2D Font Engine
322(12)
ASCII Codes and Your Source Alphabet
323(8)
Printing Multiple Characters to the Screen
331(1)
Start Up that Engine!
332(2)
Developing a 2D Sprite Engine
334(21)
Sprite Class Definition
336(3)
Sprite Initialization
339(5)
Sprite Rendering
344(1)
Sprite Animation
345(2)
Sprites in Action
347(6)
Advanced Sprite Topics
353(2)
Getting Down with Layers
355(15)
Implementing Layers
357(13)
Conclusion
370(1)
California-Style Consoles
371(42)
Console Overview
372(2)
Implementing the Console
374(2)
The CEntry Class
376(7)
Adding Text to the Entry
379(4)
Getting Down with CConsole
383(7)
Console Initialization
390(11)
Entry Management
393(2)
Outputting Strings to the Console
395(1)
Clearing the Console
395(1)
Class CCommand
396(1)
Setting Up the External Parsing Callback
397(1)
Preparsing Raw Strings into Command Parameters
398(3)
Plugging the Console into the Game Engine
401(4)
OnChar[]
401(2)
OnKeyDown[]
403(2)
Rendering...Finally!
405(3)
Programming the Command Parser
408(4)
Commands with No Parameters
409(1)
Commands with Parameters
409(3)
Conclusion
412(1)
Part Four 3D Mathematics 413(326)
Getting Fat with 3D
415(60)
What is a Dimension?
416(8)
Getting Jiggy with Philosophy
417(1)
Representing the Universe with Numbers
418(6)
Triangle Mesh Types
424(4)
Moving to the Third Dimension
428(2)
Geometric Transformations
430(9)
Translation
430(1)
Scaling
431(3)
Rollin' with Rotation
434(5)
Coordinate Systems
439(2)
What's the Vector, Victor?
441(10)
Creating Vectors
442(1)
The Magnitude of a Vector
443(1)
Adding Vectors
444(1)
Subtracting Vectors
445(1)
Vector Multiplication---The Scalar Way
446(1)
Vector Multiplication---The Dot Way
447(2)
Vector Multiplication---The Cross Way
449(1)
Vector Normalization
450(1)
Matrices---Which Pill to Take?
451(7)
Matrix Addition
452(1)
Matrix Subtraction
453(1)
Matrix Scalar Multiplication
454(1)
Matrix Multiplication (Real Man's Multiplication)
454(2)
Put Down the Gun, Step Away from the Coax Connection, and Identify Yourself
456(1)
Matrix Concatenation
457(1)
Invert This Bad Boy
457(1)
Applying Matrices to 3D Transformations
458(3)
Translation
458(1)
Scaling
459(1)
Rotation
460(1)
The Transformation Pipeline
461(1)
The Local to World Transform
461(1)
The World to Camera Transform
462(1)
The Camera to Projection Transform
462(1)
Clipping
462(1)
Back Face Culling
463(2)
Depth Buffering
465(2)
The Painter's Algorithm
465(1)
Z-Buffering
466(1)
Lighting
467(4)
Ambient Lights
468(1)
Point Lights
468(1)
Directional Lights
469(1)
Spot Lights
469(1)
Light Properties
470(1)
Materials
471(2)
Conclusion
473(2)
Getting to Know Direct3D in a More 3D Sort of Way
475(56)
Getting Back to the Setup Code
476(10)
The Include Files
476(1)
The Globals
477(1)
The Window Procedure
477(2)
Getting Down with WinMain[]
479(3)
Gamelnit
482(2)
Shutting Down with GameShutdown[]
484(1)
Getting the GameLoop[] Going
485(1)
Rendering with Render[]
485(1)
Constructing a 3D Graphics Engine: The Basics
486(19)
Setting up the Flexible Vertex Format
487(3)
Getting Jiggy with the Vertex Buffer
490(5)
Rendering the Triangle
495(10)
Animation with Matrices
505(9)
Modifying the Vertex Structure
505(1)
Setting Up the Viewport
506(2)
Setting Up the Projection Matrix
508(2)
Setting the Camera Position with the View Matrix
510(2)
Animating the Triangle with the World Matrix
512(1)
Disabling Culling and Lighting
513(1)
Turning on the Lights
514(8)
Defining Vertex Normals
515(3)
Enabling Light Indices
518(1)
Setting Up Lights with D3DLIGHT8
518(2)
Setting Up Materials
520(2)
Using Textures
522(7)
Texture Coordinates
523(3)
Creating a Texture from a File
526(2)
Enabling the Texture
528(1)
Conclusion
529(2)
Building the Zen 3D Engine
531(58)
Getting a Permanent Vertex Format...Finally!
532(4)
Creating a Base Game Object
536(2)
Encapsulating the View Matrix
538(5)
Moving the Camera
540(2)
Updating the Camera
542(1)
Using the Camera
542(1)
Getting to the Point
543(8)
Creating a Point Object
544(5)
Putting Points to Work
549(2)
Ask No Questions, See No Lines
551(4)
Getting Classy with Lines
551(2)
Rendering Lines
553(1)
Using Lines
554(1)
Line Lists
555(10)
The CZenLineList Class
557(4)
Rendering Line Lists
561(4)
Point Lists
565(3)
The Face Object
568(7)
Setting the Texture
569(2)
Setting Vertex Properties
571(1)
Rendering Textured Faces
572(2)
CZenFace in Action
574(1)
Rendering Cubes with Indexed Vertices
575(12)
Indexed Rendering
577(1)
The CZenCube Class
578(8)
CZenCube in Action
586(1)
Conclusion
587(2)
Directing Input with DirectInput
589(24)
Johnny 5 Need Input
590(3)
Read This or Die!
590(1)
DirectInput Overview
591(1)
DirectInput Components
592(1)
Implementing DirectInput
593(19)
Setting Up DirectInput
593(1)
The Code---Initialization and Release
594(1)
Coding for the Keyboard
595(9)
Programming the Mouse
604(7)
The State of the Union
611(1)
Conclusion
612(1)
3D Game Engineering
613(88)
Encapsulating Materials into CZenMaterial
615(4)
Loading External 3D Models
619(15)
Dealing with the Devil: Conv3DS.exe
620(1)
The Default Texture
621(2)
The Holy Grail: CZenMesh
623(11)
Introduction to Frames
634(15)
The Right Frame of Mind
635(2)
Modifying the Zen Engine to Use Frames
637(3)
Programming Frames
640(9)
The Light of My Life
649(8)
Defining CZenLight
650(2)
The Color of Light
652(1)
Turn on the Lights!
653(1)
Updating Lights with Direct3D
654(2)
Ambient Lights
656(1)
Using CZenLight
656(1)
Advanced Synchronization
657(2)
Extending the Camera
659(20)
Camera Orientation
661(6)
Creating the View Matrix...the Hard Way
667(10)
Oh, Yes---Connecting the Camera to DirectInput
677(2)
Miscellaneous Items
679(20)
Rendering Real Fonts
679(6)
Direct3D Sprites
685(9)
The Vsync
694(5)
Conclusion
699(2)
Advanced Graphics Techniques
701(38)
Developing an Advanced Frame-Based Hierarchy System
702(15)
Getting Changed
703(4)
Adding Child Frames
707(2)
Dealing with Additive Transformations
709(2)
Rendering with Frame Trees and Object Lists
711(2)
Programming Pluggable Frame Behavior Modification Routines
713(4)
Bringing Structure to the Zen Engine
717(2)
Everything in Action...Finally!
719(5)
Bilinear Filtering and Scene Anti-Aliasing
724(2)
Using the Direct3D Texture Utility to Create Advanced Textures
726(3)
Using Custom Mouse Cursors
729(8)
Initialization
732(1)
Positioning the Mouse
733(2)
Updating the Cursor Position
735(1)
Using CZenMouse and the Custom Cursor
736(1)
Conclusion
737(2)
Part Five Appendices 739(103)
Appendix A C++ Programming 101
741(30)
C, C++: What's the Difference?
742(1)
Classes
743(1)
Inheritance
744(1)
Polymorphism
745(1)
The Basics of Implementing C++
746(1)
Comments
746(1)
True Constants
747(1)
Creating Variables
748(2)
Passing Variables by Reference
750(1)
Streaming Input and Output
751(3)
Managing Memory
754(1)
Classes
754(1)
Data Representation in the Dark Ages
755(1)
A Basic Class
755(1)
Accessing Class Data Elements
756(2)
Member Functions
758(2)
Constructors and Destructors
760(4)
Scope Resolution
764(2)
Friend Functions
766(2)
Function and Operator Overloading
768(2)
Conclusion
770(1)
Appendix B Direct 3D Advanced Reference
771(71)
C++ Functions
772(1)
Direct3Dcreate8[]
772(1)
COM Interfaces
773(1)
IDirect3D8
773(8)
IDirect3DDevice8
781(50)
IDirect3DIndexBuffer8
831(2)
IDirect3DSurface8
833(4)
IDirect3DTexture8
837(3)
IDirect3DVertexBuffer8
840(2)
Index 842

An electronic version of this book is available through VitalSource.

This book is viewable on PC, Mac, iPhone, iPad, iPod Touch, and most smartphones.

By purchasing, you will be able to view this book online, as well as download it, for the chosen number of days.

Digital License

You are licensing a digital product for a set duration. Durations are set forth in the product description, with "Lifetime" typically meaning five (5) years of online access and permanent download to a supported device. All licenses are non-transferable.

More details can be found here.

A downloadable version of this book is available through the eCampus Reader or compatible Adobe readers.

Applications are available on iOS, Android, PC, Mac, and Windows Mobile platforms.

Please view the compatibility matrix prior to purchase.