Developing your own 3D game engine can be a demanding task. If you're up for the challenge, then "3D Game Engine Programming" is ready to take you through each step. All you need to begin is a working knowledge of C or C++and basic knowledge of the DirectX and Direct3D interfaces. With these skills behind you, you're ready to tackle the mathematical concepts and API-independent interfaces that will add up to your working game engine. This book takes you beyond simply building your game engine, showing you how you can apply it to implement a network deathmatch first-person shooter. You'll also cover additional tasks such as implementing a level editor to build your own 3D levels from scratch with a graphical user interface. 3D Game Emgine Programming 1 Acknowledgments 7 About the Authors 9 About the Series Editor 10 Contents at a Glance 12 Contents 14 Introduction 25 PART I 34 Introduction to the Topics 34 Chapter 1 36 3D Engines and Game Programming 36 Buzzword Engine 36 A Kind of Magic 39 The Development Process of a Video Game 43 Direct3D versus OpenGL Wars 59 Why Do It the Hard Way If There Is an Easy Way? 61 Get Ready to Rock 62 Chapter 2 64 Designing the Engine 64 Requirements for the Engine 64 API Independence through Interface Definitions 67 The Structure of the Engine 68 Components of the Engine 70 One Look Back, Two Steps Forward 72 Chapter 3 74 Engineering the Engine 74 What Is an Interface? 74 Defining the Interface 76 Workspace for the Implementations 78 Implementing the Static Library 85 Implementing the DLL 91 Testing the Implementation 115 One Look Back, Two Steps Forward 122 Chapter 4 124 Fast 3D Calculus 124 Fast, Faster, the Fastest 125 Working with Vectors 148 Working with Matrices 159 Working with Rays 164 Working with Planes 176 Working with AABBs and OBBs 183 Working with Polygons 195 Working with Quaternions 210 One Look Back, Two Steps Forward 217 PART II 220 Rendering Graphics 220 Chapter 5 222 Materials, Textures, and Transparency 222 Middle Management 223 A Class for Skins 226 Adding Skins and Textures 246 Adding Textures 248 Adjusting the Transparency of Textures 259 One Look Back, Two Steps Forward 266 Chapter 6 268 The Render Device of the Engine 268 Project Settings 269 View and Projection 270 Vertex Structures 299 Shader Support 300 Activating Render States 311 Rendering Primitives Efficiently 315 Rendering Text, Points, and Lines 352 Rendering Point Lists 356 Presenting a Scene 360 Demo Application Using the DLL 363 One Look Back, Two Steps Forward 367 Chapter 7 368 3D Pipelines and Shaders 368 Shader Basics 369 Shader Techniques and Samples 377 One Look Back, Two Steps Forward 419 Chapter 8 420 Loading and Animating 3D Models 420 Triumphant Advance of Skeletal Animation 421 The CBF File Format 427 Processing the Data in the Memory 451 Using the Animated Model 471 One Look Back, Two Steps Forward 477 PART III 478 Support Modules for the Engine 478 Chapter 9 480 The Input Interface of the Engine 480 Good Old Interface Design 481 Interface Definition for an Input Class 482 Base Class for Input Devices 483 Getting Down to the Keys 491 The Pied Piper of Redmond 494 No Joy Without a Joystick 500 Implementing the Interface 505 Demo Application 510 One Look Back, Two Steps Forward 514 Chapter 10 516 The Audio Interface of the Engine 516 Quick and Painlessly 516 Implementing the Interface 520 Demo Application 534 One Look Back, Two Steps Forward 534 Chapter 11 536 The Network Interface of the Engine 536 Network Games 537 Network Architecture 541 Network Technology 544 Implementing a Network Library 548 Demo Application 586 One Look Back, Two Steps Forward 600 Chapter 12 602 Timing and Movement in the Engine 602 Different Camera Modes 603 Movement by a ZFXMovementController 605 Demo Application 617 One Look Back, Two Steps Forward 617 Chapter 13 618 Scene Management 618 The Concept of Scene Management 619 Scene Management Techniques 620 Implementing a BSP Tree 655 Class Declaration 657 Implementing an Octree 669 Demo Application: Octree and BSP Tree 686 One Look Back, Two Steps Forward 696 PART IV 698 Black Art of Game Programming 698 Chapter 14 700 Computer-Aided Design (CAD) Tools 700 Using CAD Tools 700 Low-Polygon Editor: PanBox-Edit 703 Class Design of the Tool 705 Selected Aspects of the GUI 810 One Look Back, Two Steps Forward 818 Chapter 15 820 Deathmatch Shooter 820 Deathmatch Shooter: Pandora’s Legacy 820 In the Shadows of Ourselves 822 Loading a Level 839 Rendering a Level 854 Integrating Characters 864 CGame, a Class of Its Own 869 One Look Back, Two Steps Forward 874 Epilogue 876 INDEX 878 End of Book 24 A full-blown game engine is now an important industrial asset. Current engines exist with licensing fees of several $100,000, plus profit share costs. Because of these high costs, hobbyist game programmers are eager to learn how to write their own engines. The availability of a game engine which is ready to rock simplifies the development process of a game, allowing developers to concentrate on the game and gameplay experience. "3D Game Engine Programming" shows game programmers how to develop such an engine.