December 2004
Beginner
432 pages
10h 17m
English
Before you finish this chapter, you implement the camera class. During the Blockers game, you handled all the camera movements (mainly the view transform) on your own. Although it is a completely viable option, it can be a little annoying. Having an abstracted camera class is more natural. Create a new code file (call it camera.cs) in your project, and use the code from Listing 13.11 for the initial implementation.
using System; using Microsoft.DirectX; using Microsoft.DirectX.Direct3D; namespace Tankers { public class Camera { // Attributes for view matrix private Vector3 eyeVector; private Vector3 lookAtVector; private Vector3 upVector; // Matrix for the view transform private Matrix ... |
Read now
Unlock full access