RailroadBookstore.com

Railroad Books - Model Railroad Books - Thomas & Friends
Photography Books - Gardening Books

Photography Books

Huge Selection - Discount Prices - Money Back Guarantee

We offer a huge selection of photography books at discount prices. All purchases have a money back satisfaction guarantee. Thank you for shopping here!

Search Advanced SearchView Cart   Checkout   
Guidebooks
Canon
Hasselblad
Kodak
Leica
Nikon
Pentax
Sony
Magic Lantern Guides
Categories
General
Black & White
Color
Digital
Equipment
How To
Nature & Wildlife
Photo Essays
Photojournalism
Reference
Travel
Photoshop
Lightroom
Railroad Photography
Images of Rail Series
Subcategories
Internet Games
Strategy Guides
Video Games
Mass Market
Trade

Introduction to 3D Game Programming with DirectX 9 (Wordware Game and Graphics Library)

Introduction to 3D Game Programming with DirectX 9 (Wordware Game and Graphics Library)

zoom enlarge 
Author: Frank D. Luna
Publisher: Wordware Publishing Inc.
Category: Book

List Price: $49.95
Buy New: $26.77
You Save: $23.18 (46%)



New (13) Used (8) from $16.99

Avg. Customer Rating: 4.5 out of 5 stars 45 reviews
Sales Rank: 195759

Media: Paperback
Number Of Items: 1
Pages: 400
Shipping Weight (lbs): 1.2
Dimensions (in): 8.9 x 6 x 0.9

ISBN: 1556229135
Dewey Decimal Number: 794.815268
EAN: 9781556229138
ASIN: 1556229135

Publication Date: May 25, 2003
Availability: Usually ships in 1-2 business days
Shipping: International shipping available
Condition: Brand new item. Over 3.5 million customers served. Order now. Selling online since 1995. Few left in stock - order soon. Code: N20080825073934N

Similar Items:

  • Introduction to 3D Game Programming with Direct X 9.0c: A Shader Approach (Wordware Game and Graphics Library)
  • Programming a Multiplayer FPS in DirectX (Game Development Series)
  • 3D Math Primer for Graphics and Game Development (Wordware Game Math Library)
  • Programming Game AI by Example
  • Managed DirectX 9 Kick Start: Graphics and Game Programming (Kick Start)

Editorial Reviews:

Product Description
This book instructs the reader from the beginning by teaching the underlying mathematics and 3D theory necessary to make sense of the DirectX 9 API.


Customer Reviews:   Read 40 more reviews...

4 out of 5 stars The best book I have found so far   March 25, 2007
 3 out of 3 found this review helpful

This is the best intro to Direct3d book I have. For the game programming aspect, it sucks, but there are so many books that tell you how to make a certain type of game (Premier Press come to mind).

The first section is purely math! This surprised me since it's the only Direct3d book I have found that covered that much math.

The reasons why I gave it 4 out of 5: could be better. It needs more complete sample code. I mean, there's sample code on his web page, but the sample code starts at chapter 9! However, the (incomplete) code before chapter 9 is pretty easy to follow. Whenever he omits a piece of information, it's minor details like

int stuff[10] = { ... }; // fill stuff in with stuff

The book provides a very detailed explanation on how Direct3d works. Sure, there are times where he puts "see the MSDN for this struct", but that's usually when there's not much explaining he could do that's not in the MSDN already. I like that it feels like the author took a good deal of time to figure out how to explain every topic. The information is incredibly clear.

If you are like me and look at a bunch of DirectX books and just have no idea what the author(s) is talking about, you should try this book, especially if you have a good math background. And if this dude releases a book on DirectX 10, I'll definitely get it. If you know DirectX and are looking for a book on game programming, look for another book.



4 out of 5 stars A very good introductory book   February 26, 2007
 2 out of 6 found this review helpful

This review covers the first 13 chapters. It is a book that you will definitely learn from; however, beware that it is not written for users of C#. C# samples can be downloaded from the book's web site and I talk extensively about that in this review. This review is more a How-To than anything else - it documents my experience with the book and using the sample code from the book's web site. I am new to 3D game programming so I started out with giving myself a crash course in Linear Algebra (for this I studied the book, "3D Math Primer for Graphics and Game Development").

In Part 1 the author could do a better job of explaining how a vector cross product is calculated. He refers to "formula (4)" which is a formula in final form (i.e. it does not show the steps). Furthermore, "formula (4)" comes seven pages after the first three formulas, so when you come to "(4)" (on page 13) you may have already forgotten about (1), (2) and (3) (which are on page 6) -- it is awkward. It should be highlighted and labeled as "FORMULA 4:" or something like that.

In Part II, Chapter 1 (Direct3D Initialization), section 1.4.1 describes initializing a pointer to an IDirect3D9 interface as...
IDirect3D9* _d3d9;
however, in section 1.4.2 the code for checking the capabilities of the primary display adapter shows this code...
d3d9->GetDeviceCaps...
The underscore character is missing from the IDirect3D9 object. It should read...
_d3d9->GetDeviceCaps

The source code can be downloaded from http://www.moon-labs.com/ml_book_samples.htm. C# versions of the sample programs are available. The download instructions include a username/password but I was able to download the files without having to provide them. Should you be prompted for a username/password the author's instructions state, "The user name is exactly the second word on page 212 in the first paragraph of Chapter 13. The password is exactly the fourth word on page 213 in the first paragraph of section 13.1." Let's cut to the chase, its "terrain/heightmap" (without the quotation marks or forward slash).

The code in the book is meant to be used in a C++ development environment. I use C# 2005 Express Edition therefore there wasn't anything I could do with the code in the book. When you open a sample code project (one from the C# versions available at the web site) in the C# 2005 Express Edition, a "Visual Studio Conversion Wizard" will prompt you to convert the project to the current edition's format. Just go ahead and click on "Finish." As I mentioned in a previous paragraph, there is a C# version of the sample programs provided on the web site.

Beginning with Chapter 3's sample and in all of the samples I could not understand why the 'Window' parameter would not work the way I understood it to work. In Form1.cs, when a d3d object is instantiated with a 'true' instead of 'false' for the Window parameter (the 3rd parameter), nothing worked. This works...
d3d = new D3DInit.D3DInit(800, 600, false, DeviceType.Hardware, ref device);
but this does not...
d3d = new D3DInit.D3DInit(800, 600, true, DeviceType.Hardware, ref device);

I had trouble with the sample for Chapter 6 (Texturing). The problem was due to the sample program's inability to find the texture image. To fix it, all I had to do was change the source code to reflect the FULL path to the image file. I'll clarify... this is the original line 136 in D3DInit.cs...

tex = Microsoft.DirectX.Direct3D.TextureLoader.FromFile(device, "dx5_logo.bmp");

I modified it to...

tex = Microsoft.DirectX.Direct3D.TextureLoader.FromFile(device, "D:\\david.emmith\\Books\\Intro to 3D Game Programming\\Part II CS\\Chapter6\\dx5_logo.bmp");
(Note: Remember to escape backslashes in path names by making double-backslashes, otherwise you'll get an error.)

The same problem occurred again in Chapter 7's sample.

In Chapter 11's sample you may find a similar problem to the ones I described above for Chapter's 6 and 7. In Chapter 11 there is a line in D3DInit.cs (line #55) that reads...

private string shipFilename = "bigship1.x";

You may need to modify it to reflect the full path name.

If you are writing your own app and using the .NET samples as a guide you may run into a few problems when you build the solution. You may see a "... has more than one entry point defined" error. This will happen if you have the following code in your Form1.cs file...

[STAThread]
static void Main()
{
Application.Run(new Form1());
}

There is no need to have those lines in your Form1.cs (or whatever filename you are using in place of Form1.cs). A Program.cs file should have automatically been created in your project (click on the 'Show All Files' icon in Solution Explorer). You can do one of two things to rectify this problem:
(1) Comment out or delete the code shown above in your Form1.cs (or its equivalent) file.
*** OR ***
(2) Exclude Program.cs from your project (right click the Program.cs icon and select 'Exclude From Project').

There is a similar situation in the D3DInit.cs file. There is no need to include the Dispose() method - it will already be in the D3DInit.Designer.cs file (this file, like Program.cs, is automatically created by the Visual C# IDE).

Another problem you may encounter if you are trying to use the Esc key to terminate your DirectX app is the Esc key not working. To solve this problem open your Form1.Designer.cs file and add the following line at the end of the InitializeComponent() method...
this.KeyUp += new System.Windows.Forms.KeyEventHandler(this.Form1_KeyUp);
Then make sure you have this method in your Form1.cs file...

private void Form1_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e)
{
d3d.CloseD3DInit();
Close();
}

And of course your D3DInit.cs file should have the CloseD3DInit() method defined. If not it should look like this...

public void CloseD3DInit()
{
displayThread.Abort();
Close();
}

In Chapter 11, as I mentioned earlier, there is a reference to a file named bigship1.x which is provided in the sample project. This is a mesh file which is nothing more than a geometric description of an object - in this case, a spaceship. If you're like me and you want to workout your own example you would like to create your own mesh file and test it in your own application. To create a mesh of your own design you will need the aid of a program. DirectX uses the .x file format for its mesh files. Some of the more popular 3D design programs do not readily provide a method for turning their meshes into the .x format. I will describe as briefly as possible the steps I took to create a simple mesh, convert it to a .x file and use it in my own program. There is probably a better way but this is the way I did it.

(1) Find a FREE 3D design program. I downloaded and installed two programs:

(a) Maya 7.0 Personal Learning Edition

(a.1) Can be found at the Autodesk web site.

(b) Autodesk 3DS Max 9 (30-day trial)

(b.1) Can be found at the Autodesk web site.
I was more interested in 3DS Max because I have my eyes on some aircraft models I want to use and they were created in the .max file format. So this is the program I used to create a very simple model.

(2) Create a model. I created a sphere with a green texture in 3DS Max. I won't go into the details of how I did that because it is not that difficult to figure out on your own. You may want to create something a little more 'elaborate' than a green sphere. Have at it.

(3) Convert the model into an x-file. This sounds simple enough but try doing it on the cheap, i.e. $0.00.

(a) If you want to pay for a conversion utility up front then check out two products from Okino Computer Graphics:

(a.1) NuGraf

(a.2) Polytrans (a simpler version of NuGraf)
It should be noted that Robert Lansdale (lansd[at]okino.com) offered to do a one-time conversion for me. I emailed him my .max file and he sent me back a .x file. I had already done the conversion by the time he sent the file back but I certainly appreciated his kind gesture.

(b) If your cheap like me you want to do this for free because afterall, you're just trying to learn how all this works. I contacted a 3D guru by the name of Chad Vernon. Chad was very helpful in pointing out a couple of free conversion tools:

(b.1) kiloWatt X file Exporter

(b.2) Pandasoft's Panda Xporter Tool

(c) I used Panda Xporter. After you unzip the .zip file you have a file named PandaDirectXMaxExporter.dle. This is a 'plugin'. So what you need to do next is to make this file known to 3DS Max and the way you do that is place the file in 3DS Max's plugin folder. On my machine this folder is located at D:\Program Files\Autodesk\3ds Max 9\plugins. Now you are ready to convert your model to the .x file format.

(d) Launch 3DS Max (close the Welcome Screen if it appears) and open your model file (File | Open Recent). The first time I did this with the Panda Xporter in place 3DS Max crashed. I removed the Xporter from the plugin folder and re-launched 3DS Max. It crashed again. I eventually got it to work and put the Xporter back in the plugin folder. 3DS Max did not crash after that. This remains a mystery. The problem appeared to have fixed itself.

(e) Select File | Export. Click on the down arrow for 'Save as type' and choose Panda DirectX (*.X). Click in the 'File name' textbox and enter a file name without a file extension. Note where the file is being saved to. You will need to know the full path to your .x file when you create your own 3D app. Click on 'Save'.

(f) In the 'PandaSoft DirectX Exporter' dialog, '3DS Max Objects' tab, uncheck 'Include Animation' if your object is not animated. In the 'XFile Settings' tab, the 'DX File Type' of either 'Text' or 'Binary' worked for me. I believe the default is text. Click 'OK'.

(4) Create your own 3D app. Again, I am using Visual C# 2005 Express Edition. Use the C# samples provided at the book's web site to guide you. Remember, as I have pointed above, that there are some differences that come into play between the samples and what you create in a Visual Studio 2005 environment. Read through my earlier comments.

I hope this helps. Now on to the review.

In Chapter 12's sample, line #138 of D3DInit.cs needs the full path to dx5_logo.bmp. I described this same problem in earlier chapter reviews.

In Chapter 13's sample, line #601 of D3DInit.cs refers to a temp.raw file. This file, as far as I can tell, is not included in the managed (.NET) sample files. So I came up with my own work around which I describe below...

(1) Download Terragen which is a free terrain generation tool. Look for the link labeled, "Install Terragen v0.9.43 (1.6Mb)" in the download page. Now install Terragen.

The following steps are for once you have launched Terragen.

(2) Click on the 'Landscape' icon in Terragen and then click on the 'Generate Terrain' button.

(3) Click on the 'Export' button.

(4) In the 'Terrain Export' dialog click on the 'Export Method' dropdown listbox and choose 'Raw 8 bits'.

(5) Click on the 'Select File and Save' button and choose the name for your .raw file and its location.

Now that you have your own raw file you can insert the file's full pathname into the Chapter 13 sample.

If you have found or already have Terragen .ter files you can convert them to .raw files with a little free utility named 'Terrify'.

The book's web site has some additional information pertaining to Chapter 13. You can go to the Resources page and scroll down to 'Basic Terrain Rendering Part II'. The 'Download Code' link will give you a file named 'TexBlendTerrain.zip' which, according to my WinZip utility, is not a recognized Zip file. The links in 'Remark 2' do not work (they take you to some useless page).

This is the extent of my review. This is a very good book but I wish it were geared towards .NET developers.



3 out of 5 stars An introduction. Nothing more, nothing less.   February 5, 2007
I guess this book delivers what it promises, more or less. It effectively introduces you to directx. It devotes 20 or so pages to each of 20 or so topics (the dimensions of the book are real small though, so the page counts are somewhat misleading). By the end of the book you'll understand what directx is and what directx can do, but what I found is that there just isn't enough "meat" there to learn any part of directx well enough to do anything useful with this knowledge.


4 out of 5 stars Great book to get started. Clear and Concise   October 10, 2006
 3 out of 3 found this review helpful

I started DirectX programming recently. This book brings you upto speed very fast. It is well organized, written well, and is kept very simple. It's objective is to teach concepts and how to program specific concepts is C++. The examples and straightforward and illustrate whats in the text very well.

Like all other reviewers, I should agree that the title of this book is misleading. There is very little, if any "Game development". The book is all about the basics of 3D drawing using drect X

If you want to start programming DirectX over the weekend with some nice 3D graphics including textures, lights and terrains and even fireworks, this is the book for you. I highly recommend it.



5 out of 5 stars Very easy to follow   July 10, 2006
 1 out of 1 found this review helpful

This book is written very well, and it is written in a way that allows the reader to follow without getting lost in the terminology. Everything is explained very well. I use the book constantly as a reference when programming. Pick this book up if your serious about learning DirectX.


Copyright 2008 - RailroadBookstore.com