Skip to Main Content
Learning XNA 3.0
book

Learning XNA 3.0

by Aaron Reed
November 2008
Beginner content levelBeginner
510 pages
16h 24m
English
O'Reilly Media, Inc.
Content preview from Learning XNA 3.0

Setting Up the Project

Before we get to loading and drawing a model, let's apply one of the lessons from the 2D section of this book: for this project, you'll work with some object-oriented design from the beginning. In the first half of this book, you implemented a SpriteManager class that handled the drawing of all sprites. You also created a base class for all sprites and derived specialized sprites from that base class. That approach seemed to work pretty well, so you'll implement the same type of design in your 3D game.

Start from scratch in this chapter by creating a new project. Name your game 3D Game, as shown in Figure 10-1.

Creating a new project

Figure 10-1. Creating a new project

The first thing you're going to need is a camera. You created a camera using a GameComponent in the previous chapter, and you'll need to do that again here. To simplify matters, you can copy the Camera.cs file from the previous chapter and paste it into this project; or, if you haven't already done so, you can download the source code for Chapter 9 and copy the Camera.cs file into your project now. You'll need to change the namespace from _3D_Madness to _3D_Game, though, in order to be able to use the Camera class in your project.

Alternatively, you can create a new GameComponent by right-clicking the solution in Solution Explorer, selecting Add → New Item..., and selecting the Game Component template from the list on the ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning XNA 4.0

Learning XNA 4.0

Aaron Reed
Beginning C# 7 Programming with Visual Studio 2017

Beginning C# 7 Programming with Visual Studio 2017

Benjamin Perkins, Jacob Vibe Hammer, Jon D. Reid

Publisher Resources

ISBN: 9780596154905Supplemental ContentErrata Page