The Code So Far

[Previous] [Next]

That's all there is to creating a DrawPrimitive-based application! Try compiling the code for this chapter (in the Chap6 subproject for the RoadRage project on the companion CD). When you execute it, you'll see a screen similar to the one shown in Figure 6-10.

click to view at full size.

Figure 6-10 The rendered scene

The view you see is of a street with buildings, street lights, sidewalks, and so on along it. The scene uses Direct3D lights to cast lighting on the street from each of the street lights. It also uses a low-level ambient light.

As you can see, there are no textures applied to the scene yet, so everything appears white. In Chapter 8, we'll be adding textures, including an animated texture for the cloudy sky in the background, but for now, you can see that we're rendering all the polygons we load from our 3D world database (stored in the level1.map file). This map file was created using the Road Rage Editor contained in the RR_EDITOR subproject. This program allows you to graphically create a complex 3D world using a graphic editor for placing the 3D objects into your world. Using this program, you can create new 3D worlds whenever you want to. You can easily add new 3D objects into your world using the editor. Details on this project can be found in the Using the Companion CD section in the front of this book.



Inside Direct3D
Inside Direct3D (Dv-Mps Inside)
ISBN: 0735606137
EAN: 2147483647
Year: 1999
Pages: 131

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net