Directx 9 Graphics: The Definitive Guide To Direct3d


DirectX 9 Graphics: The Definitive Guide to Direct3D provides a detailed and comprehensive guide to getting started with DirectX, with a specific focus on Direct3D, a technology designed to create interactive multimedia products. This book demystifies DirectX, starting with the basics of setting up a DirectX application and finishing with the intricacies of real-time 3D ...

See more details below
Paperback (1E)
$45.14 price
(Save 24%)$59.95 List Price
Other sellers (Paperback)
  • All (3) from $19.81   
  • New (2) from $19.81   
  • Used (1) from $30.52   
Sending request ...


DirectX 9 Graphics: The Definitive Guide to Direct3D provides a detailed and comprehensive guide to getting started with DirectX, with a specific focus on Direct3D, a technology designed to create interactive multimedia products. This book demystifies DirectX, starting with the basics of setting up a DirectX application and finishing with the intricacies of real-time 3D animation. Learn how to:
• Create and render 3D worlds.
• Use index and vertex buffers to represent 3D primitives.
• Apply 3D mathematical theory to graphic design.
• Export 3D models from 3D rendering applications and import them into DirectX as meshes.
• Save and load data using X files.
• Create snow, rain, fog, and more using point sprites and particle systems.
• Animate pixel data on textures.
• Enhance your game world with real-time lighting and texture mapping.
• Employ skeletal animation to animate meshes.

Read More Show Less

Product Details

  • ISBN-13: 9781556222290
  • Publisher: Jones & Bartlett Learning
  • Publication date: 4/8/2005
  • Edition description: 1E
  • Pages: 349
  • Product dimensions: 6.12 (w) x 9.06 (h) x 0.75 (d)

Table of Contents

Acknowledgments xi
Introduction xiii
Chapter 1 Getting Started with DirectX 1
What Is DirectX? 2
A More Precise Definition of DirectX 4
Obtaining DirectX 5
Installing DirectX 5
Configuring DirectX 6
Exploring DirectX 7
DirectX Utilities 9
Conclusion 13
Chapter 2 Starting DirectX - Your First Program 15
Getting Started 16
Step 1 Create a Window 17
Step 2 Create a Direct3D Object 19
Step 3 Create a Direct3D Device 20
Creating a Device 21
More on Direct3D Devices 27
Step 4 Configure the Message Loop 28
The Game Loop 29
Step 5 Render and Display a Scene 30
Direct3D Surfaces - IDirect3DSurface9 31
Preparing to Present a Scene 32
Beginning and Ending a Scene 34
Step 6 Shut Down Direct3D 36
More on Surfaces 37
Creating Surfaces 37
Loading Images onto Surfaces 40
Copying Surfaces 42
Presenting Images with the Back Buffer 44
Lost Devices 46
Conclusion 49
Chapter 3 3D Mathematics 51
Coordinate Systems 52
One-Dimensional (1D) Coordinate Systems 52
Two-Dimensional (2D) Coordinate Systems 53
More on 2D Coordinate Systems 54
Three-Dimensional (3D) Coordinate Systems 56
Geometric Transformations 57
Translation 58
Rotation 58
Scaling 60
Vectors 61
Length of the Diagonal (Magnitude) 63
Vector Addition 64
Vector Subtraction 65
Vector Multiplication 6
Vector Normalization 67
Vector Dot Product 67
Vector Cross Product 68
Matrices 70
Matrix Components 71
Matrix Addition 72
Matrix Subtraction 72
Matrix Multiplication (Scalar) 72
Matrix by Matrix Multiplication 73
Identity Matrix 74
Inverse Matrix 75
Matrices for Geometric Transformations 76
Matrix Translation 76
Matrix Rotation 78
Matrix Scaling 81
Combining Transformations 82
Planes 83
Creating Planes from Three Points 84
Creating Planes from Point and Normal 85
Classifying Points in 3D Using Planes 86
Plane and Line Intersection 87
Conclusion 89
Chapter 4 Direct3D for 3D Graphics 91
Getting Started 92
Create and Define a Vertex Format 93
Using Vertices 94
Create a Vertex Buffer 95
Fill the Vertex Buffer 97
Rendering the Triangle 99
View, Projection, and Transform Matrices 99
Transformation Matrix 100
View Matrix 102
Projection matrix 103
Setting the Stream Source 104
Setting the FVF 106
Drawing a Primitive 106
Animating the Triangle 109
Drawing Other Primitives 109
Indexed Primitives 111
Setting Up Index Buffers 113
Drawing Indexed Primitives 115
Conclusion 118
Chapter 5 Materials, Lights, and Textures 119
Lighting 120
Turning the Lights On and Off 121
More on Lights 122
Setting the Ambient Lighting 122
Getting Started with Direct Lights 123
Direct3D Shading Modes 123
Materials 124
Direct Lighting Types 126
Textures 131
Creating Textures 132
Creating Blank Textures 132
Creating Textures from Image Files 134
Texture Mapping 135
Setting the Active Texture 137
Texture Filtering 138
Texture Addressing Modes 141
Texture Alpha Blending 144
2D Texturing 145
ID3DXSprite - Drawing Textures in 2D 147
Conclusion 150
Chapter 6 X Files - Loading and Saving Data 151
Introduction to X Files 152
Structural Overview 154
Header 154
Templates 154
Data Objects 156
Parent and Child Objects 157
Data Objects and References 157
Standard Templates 159
Custom Templates 169
Reading X Files Using DirectX 170
Preparing 170
Registering Templates 171
Opening a File 173
Enumerating Top Objects 174
Enumerating Child Objects 175
Processing Child Objects 176
Enumeration Overview 176
Getting Object Data 178
Object Names 178
Object Types 179
Object Data 181
Saving Data to X Files - Save Object 182
Preparing 183
Saving Data 184
Building the Tree 185
Committing the Data 186
Conclusion 186
Chapter 7 Meshes 187
What Are Meshes? 188
How to Make Meshes 188
How to Export Meshes 189
Testing Your Mesh 190
Meshes in Direct3D 191
Loading Meshes from X Files 191
Loading Meshes from X File Data Objects 193
Mesh Materials and Textures 196
Rendering Meshes 199
Cleaning Up Meshes 200
More on Meshes 201
Meshes and Vertex Buffers 201
Meshes and FVFs 202
Bounding Boxes and Spheres 204
Rays Intersecting Meshes 209
Vertex Interpolation 212
Conclusion 214
Chapter 8 Cameras - First-Person and More 215
The Problem 216
Overview 217
Looking Around 218
Pitch 218
Roll 219
Yaw 219
Combining Rotations 220
Moving the Camera 221
Making the Camera 222
Initializing the Camera Class 223
Moving the Camera 223
Rotating the Camera 224
Building the View Matrix 225
Test Drive 228
Viewing Frustum 229
Constructing the Frustum 230
Testing for a Point 232
Testing for a Cube 232
Testing for a Sphere 234
Testing for a Mesh 234
Chapter 9 Timing and Animation 237
Time 238
Keyframe Animation 240
Hierarchical Animation 242
Linked Lists 243
Adding Items to the List 244
Clearing a Linked List 245
Object Hierarchies for Animations 245
Conclusion 248
Chapter 10 Point Sprites and Particle Systems 249
Particle Systems Overview 249
Particles in Direct3D - Point Sprites 250
Creating Point Sprites 251
Rendering Point Sprites 253
Particle Systems 254
Creating a Particle System 256
Conclusion 260
Chapter 11 Playing Video and Animating Textures 261
Playing Video Using DirectShow 261
The 1, 2, 3 of Playing a File 262
Creating the Filter Graph 262
Media Control and Event System 263
Loading a Media File 263
Configuring Events 264
Playing a File 268
Playing Video - Further Information 269
Animating Textures 270
Conclusion 272
Chapter 12 More Animated Texturing 273
Movie Files (MPG, AVI, and More) 274
Playing Video on Textures in Theory 274
Playing Video on Textures in Practice 275
Creating the Base Video Renderer 276
Implementing the Base Video Renderer 277
Implementing the Constructor 278
Implementing CheckMediaType 278
Implementing SetMediaType 279
Implementing DoRenderSample 282
Preparing the Filter Graph 287
Conclusion 293
Chapter 13 Skeletal Animation 295
What Is Skeletal Animation? 295
Skinned Meshes 296
The Structure of a Skinned Mesh 297
Loading a Skinned Mesh from an X File 299
Bone Hierarchies 302
Loading the Bone Hierarchy 306
Mapping the Bone Hierarchy to the Mesh 310
Updating the Mesh 311
Rendering the Mesh 314
Animating the Skeleton 314
Loading Animations 319
Playing Animations 325
Conclusion 328
Afterword 329
Appendix A DirectX Q&A 331
Appendix B Recommended Reading 343
Index 345
Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star


4 Star


3 Star


2 Star


1 Star


Your Rating:

Your Name: Create a Pen Name or

Barnes & Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation


  • - By submitting a review, you grant to Barnes & and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Terms of Use.
  • - Barnes & reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously

    If you find inappropriate content, please report it to Barnes & Noble
    Why is this product inappropriate?
    Comments (optional)