When a 3D game reaches the end, sometimes the camera will go up and rotate around the player. On the other hand, when a 3D game just begins, a camera will fly from a very far point to the player's position very fast, like a Hollywood movie. It's impressive and fantastic. In this recipe, you will learn how to create this effect.
1. First of all, we create a Windows Phone Game project, change the name from
Game1.cs
toRoundRotateCameraGame.cs
. Then, add two 3D models,tree.fbx
andbox.fbx
, to the content project.2. Declare the variables used in the game in the
RoundRotateCamerGame
class:// View matrix for camera Matrix view; // Projection matrix for camera Matrix projection; // Camera position Vector3 position; // Tree and box models Model modelTree; Model modelBox;
3. Define the View and Project matrix and add the following code to the
Initialize()
method:// Camera position position = new Vector3(0, 40, 50); // Camera lookat...