Nicht aus der Schweiz? Besuchen Sie lehmanns.de

XNA 2.0 Game Programming Recipes (eBook)

A Problem-Solution Approach
eBook Download: PDF
2008 | 1st ed.
648 Seiten
Apress (Verlag)
978-1-4302-0514-2 (ISBN)

Lese- und Medienproben

XNA 2.0 Game Programming Recipes - Riemer Grootjans
Systemvoraussetzungen
35,30 inkl. MwSt
(CHF 34,45)
Der eBook-Verkauf erfolgt durch die Lehmanns Media GmbH (Berlin) zum Preis in Euro inkl. MwSt.
  • Download sofort lieferbar
  • Zahlungsarten anzeigen

In this book, XNA expert Reimer Grootjans brings together a selection of the hottest quick-start recipes in XNA programming for the Xbox and Windows PC. Advanced XNA programmers, experienced coders new to games development, and even complete beginners will find XNA Game Programming Recipes an invaluable companion when building games for fun or as commercial products. Numerous problem-solving recipes cover topics from cameras and angles, to textures, models, and lighting and shadowing, and will get you over the common hurdles encountered in both 2D and 3D XNA application design.



Riemer Grootjans received his degree in electronic engineering with a specialization in informatics at the Vrije Universiteit Brussel in Belgium. He is a member of a research team working toward a Ph.D, and is responsible for visualization of 3D data. For several years, Riemer has been maintaining a web site with tutorials for DirectX. Since the early beta stages of XNA in 2006, he has ported all his content to XNA and is helping more than 1,000 people on their path to XNA success every day. In July 2007 and 2008, he received the Microsoft 'Most Valuable Professional' Award for his contributions to the XNA community.
Join the game development revolution today! XNA greatly simplifies the development of your own games, lowering the barrier for programmers to get into game development. In XNA, you can start coding your games from the very start, a true revelation compared to other game programming environments. XNA doesn't sacrifice power for this ease of use - it is built entirely on DirectX technology.XNA expert Riemer Grootjans brings together a selection of the hottest recipes in XNA programming for the Windows PC and Xbox360 console. Advanced XNA programmers, experienced coders new to games development, and even complete beginners will find XNA 2.0 Game Programming Recipes an invaluable companion when building games for fun or as commercial products.

Riemer Grootjans received his degree in electronic engineering with a specialization in informatics at the Vrije Universiteit Brussel in Belgium. He is a member of a research team working toward a Ph.D, and is responsible for visualization of 3D data. For several years, Riemer has been maintaining a web site with tutorials for DirectX. Since the early beta stages of XNA in 2006, he has ported all his content to XNA and is helping more than 1,000 people on their path to XNA success every day. In July 2007 and 2008, he received the Microsoft "Most Valuable Professional" Award for his contributions to the XNA community.

Contents at a Glance 5
Contents 6
About the Author 10
About the Technical Reviewer 11
Acknowledgments 12
Introduction 13
Getting Started with XNA 2.0 15
1- 1. Install XNA Game Studio 2.0 15
1- 2. Start Your First XNA 2.0 Project 17
1- 3. Deploy Your XNA2.0 Game on Xbox 360 20
1- 4. Deploy Your XNA2.0 Game on Another PC 22
1- 5. Customize Game Loop Timing 24
1- 6. Make Your Code Plug-and- Play Using GameComponents 25
1- 7. Allow Your GameComponents to Communicate with Each Other by Implementing GameServices 29
1- 8. Save and Load Data to/ from a File 33
Setting Up Different Camera Modes in Your 3D World 39
2- 1. Set Up the Camera: Position, Target, and View Frustum 39
2- 2. Specify the Target of Your Camera 47
2- 3. Create a First- Person Shooter Camera: A Quake- Style Camera 53
2- 4. Create a Freelancer-Style Camera: Full 3D Rotation Using Quaternions 59
2- 5. Check Whether an Object Is in Sight of the Camera 66
2- 6. Detect Camera Collision Against Models, Walls, or Terrains 71
2- 7. Create a Camera Fly- by Action 74
2- 8. Remove the Solid Background Color: Skybox 84
2- 9. Draw Only the Parts of the Scene That Are in Sight of the Camera: Octree 96
2- 10. Use a Quadtree to Hide Parts of a Grid That Are Not in Sight 118
2- 11. Set Up a Post- Processing Framework 127
2- 12. Create a Blur/ Glow Post- Processing Effect 139
2- 13. Define an Orthogonal Projection Matrix to Generate a Depth Map of the Scene 149
Working with 2D Images/ Textures in XNA 2.0 158
3- 1. Display 2D Images: Load and Render Images Using the SpriteBatch Class 159
3- 1. Rotate, Scale, and Mirror an Image 164
3- 3. Render Transparent Images Using Layers 166
3- 4. Consider Performance When Using the SpriteBatch Class 170
3- 5. Display Text 173
3- 6. Create a 2D Menu Interface 175
3- 7. Create a Texture, Define the Color of Each Pixel, Save a Texture to a File 189
3- 8. Render the Scene into a Texture 191
3- 9. Extend the Image Content Processor 195
3- 10. Extend the Image Content Processor: Grayscale Conversion and Processor Parameters 208
3- 11. Make Your Scene More Impressive with Billboarding: Render 2D Images in a 3D World So They Always Face the Camera 212
3- 12. Create a 3D Explosion Effect/ Simple Particle System 233
3- 13. Create a Mirror: Projective Texturing 246
Working with Models 260
4- 1. Load and Render a Model Using the BasicEffect Class 261
4- 2. Set Different World Matrices for Different Objects, Combining World Matrices 265
4- 3. Find the Rotation Angle Corresponding to a Direction 271
4- 4. Use Acceleration to Control Velocity 273
4- 5. Construct the Global BoundingSphere Around a Model 278
4- 6. Scale the Model to a Predefined Size 280
4- 7. Render a Model Using Custom Effects and Custom Textures ( Easy Approach) 282
4- 8. Visualize the Bone Structure of a Model 287
4- 9. Make the Bones Move Individually: Model Animation 294
4- 10. Use BoundingSpheres for Basic Model Collision Detection 299
4- 11. Use Ray- Traced Collision Detection for Small/ Fast Objects 305
4- 12. Extend the Model Content Processor to Load Custom Effects ( Clean Approach) 308
4- 13. Gain Direct Access to Vertex Position Data by Extending the Model Processor 315
4- 14. Gain Direct Access to Vertex Position Data of Each ModelMesh by Extending the Model Processor 320
4- 15. Gain Direct Access to Vertex Position Data by Defining a Custom TypeWriter and TypeReader 325
4- 16. Store Multiple Objects in the Tag Property by Defining a Custom TypeWriter and TypeReader 335
4- 17. Correctly Tilt a Model Corresponding to the Terrain Underneath 342
4- 18. Detect Ray- Model Collisions Using Per- Triangle Checks 353
4- 19. Detect Whether the Pointer Is Over a Model 362
Getting the Most Out of Vertices 367
5- 1. Render Triangles, Lines, and Points in a 3D World 368
5- 2. Apply a Texture to Your Triangles 379
5- 3. Remove Redundant Vertices Using Indices 387
5- 4. Store Your Vertices and Indices in the Memory of Your Graphics Card Using a VertexBuffer and an IndexBuffer 391
5- 5. Store Your Vertices in a DynamicVertexBuffer for Frequently Updated Data 396
5- 6. Enable Backface Culling: What It Is and What It Can Do for You 399
5- 7. Automatically Calculate the Normals for All Vertices in a VertexBuffer 403
5- 8. Create a Terrain Based on a VertexBuffer and an IndexBuffer 409
5- 9. Calculate the Exact Height of a Terrain Between Vertices Using Bilinear Interpolation 419
5- 10. Calculate the Collision Point Between the Pointer and the Terrain: Surface Picking 425
5- 11. Extend the TextureProcessor to Generate a Terrain Object from an Image: Advanced DOM Objects 432
5- 12. Write a Custom Content Importer: Loading a Terrain from a CSV File 444
5- 13. Load Data from an XML File 451
5- 14. Create Your Own Vertex Format 457
5- 15. Introducing Bump Mapping: Fixed Normal 467
5- 16. Adding Per-Pixel Detail by Bump Mapping in Tangent Space 472
5- 17. Add an Ocean to Your 3D World 484
5- 18. Apply Catmull- Rom Interpolation in 3D to Generate Additional Vertices 497
5- 19. Create the Vertices for a Racing Track 501
Adding Light to Your Scene in XNA 2.0 511
6- 1. Define Normals and Use the BasicEffect 512
6- 2. Share Normals Between Vertices 518
6- 3. Add Higher Detail to Your Lighting: Per- Pixel Lighting 523
6- 4. Add Specular Highlights to Reflective Surfaces 526
6- 5. Add HLSL Vertex Shading 528
6- 6. Define a Point Light Using HLSL 534
6- 7. Add HLSL Per-Pixel Lighting 536
6- 8. Define a Spotlight Using HLSL 540
6- 9. Add HLSL Specular Highlights 542
6- 10. Add Multiple Lights to Your Scene Using Deferred Shading 547
6- 11. Add Shadowing Capability to Your Deferred Shading Engine 563
Adding Sounds to Your XNA 2.0 Project 571
7- 1. Play Simple . wav Sound Files 571
7- 2. Loop Sounds 575
7- 3. Play Sounds from a 3D Location Relative to the Camera: 3D Sound 579
Networking in XNA 2.0 583
8- 1. Sign In for Networking Services 583
8- 2. Create a Network Session 586
8- 3. Join a Networking Session 591
8- 4. Send/ Receive Data Over the Network 596
8- 5. Search for Networking Sessions Asynchronously 604
8- 6. Move from the Lobby to the Actual Game 607
Index 611

Erscheint lt. Verlag 20.9.2008
Zusatzinfo 648 p.
Verlagsort Berkeley
Sprache englisch
Themenwelt Mathematik / Informatik Informatik Programmiersprachen / -werkzeuge
Informatik Software Entwicklung Spieleprogrammierung
Informatik Weitere Themen Computerspiele
Schlagworte Design • Development • language • programming • WINDOWS
ISBN-10 1-4302-0514-8 / 1430205148
ISBN-13 978-1-4302-0514-2 / 9781430205142
Haben Sie eine Frage zum Produkt?
PDFPDF (Wasserzeichen)
Größe: 3,7 MB

DRM: Digitales Wasserzeichen
Dieses eBook enthält ein digitales Wasser­zeichen und ist damit für Sie persona­lisiert. Bei einer missbräuch­lichen Weiter­gabe des eBooks an Dritte ist eine Rück­ver­folgung an die Quelle möglich.

Dateiformat: PDF (Portable Document Format)
Mit einem festen Seiten­layout eignet sich die PDF besonders für Fach­bücher mit Spalten, Tabellen und Abbild­ungen. Eine PDF kann auf fast allen Geräten ange­zeigt werden, ist aber für kleine Displays (Smart­phone, eReader) nur einge­schränkt geeignet.

Systemvoraussetzungen:
PC/Mac: Mit einem PC oder Mac können Sie dieses eBook lesen. Sie benötigen dafür einen PDF-Viewer - z.B. den Adobe Reader oder Adobe Digital Editions.
eReader: Dieses eBook kann mit (fast) allen eBook-Readern gelesen werden. Mit dem amazon-Kindle ist es aber nicht kompatibel.
Smartphone/Tablet: Egal ob Apple oder Android, dieses eBook können Sie lesen. Sie benötigen dafür einen PDF-Viewer - z.B. die kostenlose Adobe Digital Editions-App.

Zusätzliches Feature: Online Lesen
Dieses eBook können Sie zusätzlich zum Download auch online im Webbrowser lesen.

Buying eBooks from abroad
For tax law reasons we can sell eBooks just within Germany and Switzerland. Regrettably we cannot fulfill eBook-orders from other countries.

Mehr entdecken
aus dem Bereich