XNA 4 3D Game Development by Example:Beginner's Guide
上QQ阅读APP看书,第一时间看更新

From the ground up

Even if we were to go ahead and implement the code to allow us to utilize the Camera class, there would be nothing to display at this point, as we have not defined any objects in our 3D world other than the camera, and it is invisible.

There are several different ways we could approach drawing the floor of the maze. We could draw the whole floor as a single square in a particular color. We could draw the same giant square using a texture that was repeated over the whole thing.

Both of these methods are quite valid, but we are going to take a slightly different approach. We will build a square for each cell of the maze floor, alternating the colors of the squares to create a checkerboard-like pattern. We will draw all of the floor tiles in a single operation, sending all of the geometry to the graphics card at once.