O'Reilly logo

Windows Phone 7 XNA Cookbook by Zheng Yang

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Implementing a chase camera

A chase camera will move smoothly around a 3D object and regardless of how the camera view is changed, the camera will restore to its original position. This kind of camera is useful for a racing game or an acceleration effect. In this recipe, you will learn how to make your own chase camera in Windows Phone 7.

How to do it...

  1. Create a Windows Phone Game in Visual Studio 2010, change the name from Game1.cs to ChaseCameraGame.cs. Then add the box.fbx 3D model to the content project. After the initial work, you should insert the following code to the ChaseGameCamera class as fields:
    // Loading for box model Model boxModel; // Camera View and Projection matrix Matrix view; Matrix projection; // Camera's position Vector3 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required