3D Graphics with XNA Studio 4.0
3D Graphics with XNA Studio 4.0 Review
Author: Sean James
Publisher: Packt
ISBN: 978-1-849690-04-1
Pages: 275
This book is written for people that have are already experienced with C# and want an introduction to XNA and/or 3D graphics programming.
The source code can be downloaded from the publisher’s web site, and is essential as the source code listings within the book contain only the main aspects of each sample program, which is a positive thing.
Many of the established XNA books and web sites are based on XNA 2 and XNA 3, which will cause problems when the source will not work and when trying to learn, this can be very frustrating. This book based on XNA 4.0 will quickly bring you up-to-date. There are no references to the differences between XNA 4 and earlier versions which is justified because not every reader will have been a user of the earlier versions.
Chapter 1: Getting Started with 3D
The introduction into XNA using the drawing of a camera and model is excellent, pitched at the correct level using well explained example source code. This is one of the better explanations of the various forms of cameras that I have read. For some reason a camera class seems to give novice 3D programmer’s problems, but this explanation should resolve that.
If you are displaying a lot of objects then the section on View frustum culling using bounding spheres is a good start. Includes a good example of how to create your own custom model class, which is extended and used throughout the book.
Chapter 2: Introduction to HLSL
I was surprised to see the book jump straight into HLSL in its second chapter, but realised later that this was well placed mainly due to many of the following chapters used HLSL. This is different from most other XNA books because it concentrates on 3D graphics, as the book title implies. HLSL is not covered in great detail, but enough to allow a complete understanding of the remaining chapters in the book. HLSL is a subject matter in itself and has a few books on the market but none specific to XNA. (Hint to budding XNA-HLSL authors). The HLSL chapter explains how to create a new effect and assign it to a model, replacing and saving the models built in effect. What is possibly missing at this point is an overview explanation of a models structure, (just a simple model without any animation).
Introduction into the use of models tag property to store various mesh data.
Chapter 3: Advanced Lighting
Chapter 4: Projection and Shadowing Effects
Chapter 5: Shader Effects
The best section in this chapter was on Cube mapping and how to use with a sky sphere. There is also a link to a handy utility Cube Mapper that will get you quickly creating your own Cube Maps from your own images.
http://www.innovativegames.net/blog/blog/2010/06/03/cubemapper/
Chapter 6: Billboard and Particle Effects
Also contains a well explained use of the vertex and index buffer.
Chapter 7: Environment Effects
At first I thought: On no not another terrain mesh example, but this example is well explained and documented
Chapter 8: Advanced Materials and Post Processing
Chapter 9: Animation
Easy Animation of 3D models in XNA 4 is still a problem, but this explanation makes it seem easier than it really is, mainly because of the standard “Dude” model being used. There is a mention of the need to support models with multiple animations and the problems with XNA 4, but no solution. Hopefully Microsoft and/or Autodesk will improve model multi animation support in the future.
What was missing is a quick overview of the different model structures, specifically .X and .FBX. 3D and 3D animation depends on understanding the 3D model structure, and this chapter did not delve into the subject in enough detail.
Review Conclusion
I have been a follower of Sean James first class blog at www.innovativegames.net and I am pleased to say he has maintained his usual high standard of XNA tutorials and explanations.
Yes there were a few code errors in the book listings, but these are easily sorted by examining the downloadable source code, which all works. Where the book and source differ- believe the source. Also the source code in the early chapters also contains unused classes not introduced until later chapters. For the sake of a few deletes this could have avoided confusing novices. Experienced programmers will not find this a problem.
The best XNA book yet so buy it here, and download the source code at www.PacktPub.com . Novice XNA programmers should maybe read one of the other XNA introduction books first, but this book will get you into XNA’s 3D programming.